Role: (system & assistant & user) 적용

SYSTEM: ChatGPT에게 어떻게 행동을 할지 지정하는 기능 kind of 컨셉, 마인드셋

EX:) “너는 지금부터 선생님이야 앞으로 선생님 처럼 대답해야해“

이를 사용하여 우리 서비스에 맞는 시스템 세팅을 해줄 수 있다.

ASSISSTENT: 이전 대화를 저장하고 연속성을 유지하기 위해 사용되는 role

*OpenAi의 GPT API는 우리가 흔히 사용하는 GPT처럼 이전 대화를 고려하여 진행하지 않는다.

그렇기 때문에 대화의 연속성 유지를 위해 ASSISSTENT를 사용하여 이전대화를 이거가고 있는것 처럼 보여 주어야 한다.*

USER: 일반적으로 질문하는 질문 내용

프롬프트 전략

성분 추출 기능

Untitled

  1. system - 성분 분석을 위해 유저가 선택한 전문가로 세팅

    NUTRITIONIST_SYSTEM_SETUP="You're the best nutritionist"
    
  2. user - 답변을 작성할때 고려해야 할 점, 반환 형식을 user role을 통해 작성

    EXTRACTOR_NUTRITIONIST_SETUP="I give you information about a food product, and you extract the parts of it that correspond to the ingredients.
    
    Before you answer, here are some rules to follow
    1. the answer must be in JSON format, stripped of all spaces and whitespace except for the necessary parts of the JSON format.
    2. The return value should always be in the form of an array and look like this: Example: [ingredient1 name and contents (if indicated)., ingredient2 name and contents (if indicated).] If [ingredient1 name and contents (if indicated).] cannot be applied to the content passed in, it must return [null].
    3. Use only the provided answer examples and do not include an introduction or conclusion.
    4. All answers must be written in Korean and end with '-습니다.'.
    5. All answers must be written in Korean.
    6. Do not change the names of the provided materials.
    "
    
  3. assistant - GPT의 답변으로 assistant 를 사용하여 강제성을 부여

    ASSISTANT_SETUP="Sure, I will follow all rules."
    
  4. user - 전달 된 성분 입력

성분 분석후 답변 생성

Untitled