시작하기무료로 시작하기

Few-shot 프롬프트: 모든 예시 추가!

이제 마지막 단계예요! 최종 예시인 Comfortable, but not very pretty = 2를 프롬프트에 추가해서 성능이 더 좋아지는지 확인해 보세요.

이 연습은 강의의 일부입니다

Python으로 DeepSeek 활용하기

강의 보기

연습 안내

  • 프롬프트에 Comfortable, but not very pretty = 2 예시를 추가하고 요청을 다시 실행하세요.

실습형 인터랙티브 연습

이 예제를 이 샘플 코드를 완성하여 풀어보세요.

client = OpenAI(api_key="", base_url="https://api.together.xyz/v1")

# Add the final example
prompt = """Classify sentiment as 1-5 (negative to positive). Return no explanations:
1. ____
2. Love these! = 5
3. Unbelievably good! = 
4. Shoes fell apart on the second use. = 
5. The shoes look nice, but they aren't very comfortable. = 
6. Can't wait to show them off! = """

response = client.chat.completions.create(model="deepseek-ai/DeepSeek-V4-Pro", messages=[{"role": "user", "content": prompt}], max_tokens=500)
print(response.choices[0].message.content)
코드 편집 및 실행