퓨샷 프롬프팅: 예시를 모두 활용합니다!
이제 마지막 단계입니다! 프롬프트에 Comfortable, but not very pretty = 2 예시를 추가해 보세요. 이 예시는 보다 중립적인 내용을 담고 있어 모델이 까다로운 끝에서 두 번째 리뷰를 처리하는 데 도움이 될 수 있습니다.
이 연습은 강의의 일부입니다
OpenAI API 활용하기
연습 안내
Comfortable, but not very pretty = 2예시를 프롬프트에 추가하고 요청을 다시 실행하세요.
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
client = OpenAI(api_key="")
# Add the final example
prompt = """Classify sentiment as 1-5 (negative to positive):
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="gpt-4o-mini", messages=[{"role": "user", "content": prompt}], max_completion_tokens=100)
print(response.choices[0].message.content)