2024/03/27 3

[GPT] Few-shot examples for chat models

[결과] AIMessageChunk(content='A triangle does not have a square. The square of a number is the result of multiplying the number by itself.') 템플릿의 기본 구성 요소는 다음과 같습니다. - examples: 최종 프롬프트에 포함할 사전 예제 목록입니다. - example_prompt: format_messages 메서드를 통해 각 예제를 하나 이상의 메시지로 변환합니다. 일반적인 예는 각 예를 하나의 인간 메시지와 하나의 AI 메시지 응답으로 변환하거나 인간 메시지와 함수 호출 메시지로 변환하는 것입니다.

python 2024.03.27

[GPT] FewShotPromptTemplate

[결과] AI: I know this: Capital: Ankara Language: Turkish Food: Kebab and Baklava Currency: Turkish Lira AIMessageChunk(content='AI:\n I know this:\n Capital: Ankara\n Language: Turkish\n Food: Kebab and Baklava\n Currency: Turkish Lira') FewShotPromptTemplate은 GPT-3나 GPT-4 같은 모델에 예제를 제공하고 예제를 기반으로 더 나은 응답을 출력할수 있도록 함 prompt = FewShotPromptTemplate( example_prompt=example_prompt, // 예제 프롬프트 exampl..

python 2024.03.27