Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mjkweon17 committed Feb 15, 2024
2 parents c99fd73 + 7e6da77 commit ffbbb75
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/gpt/comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ def generate_response(input_messages):
# Initial system message describing the role and behavior of the GPT
system_message = {
"role": "system",
"content": "이 AI는 노인분들을 잘 이해하며, 진정성이 느껴지는 짧은 답변(한 마디에서 세 마디 사이)과 질문을 한국어로 생성합니다. 공감을 표현하거나 바로 질문하는 형식으로 응답해주세요. 답변을 하는 도중 중간에 끊기지 않게 해주세요."
"content": "이 AI는 사용자의 답변을 토대로 사용자의 경험과 감정에 공감하며, 대화에 대한 마무리 멘트를 제공합니다. 답변은 간결하며 2 문장을 넘어가지 않습니다."
}


# Format the input for the OpenAI API, starting with the system message
messages = [system_message]
Expand All @@ -36,7 +37,15 @@ def generate_response(input_messages):
# Example input
input_messages = [
{"speaker": "ai", "text": "가장 기억에 남는 일은 무엇인가요?"},
{"speaker": "user", "text": "첫째 아이가 태어난 날이 가장 기억에 남아. 와이프가 아이를 낳고 나서 아이를 보여줬을 때, 정말 감동적이었어."}
{"speaker": "user", "text": "첫째 아이가 태어난 날이 가장 기억에 남아. 와이프가 아이를 낳고 나서 아이를 보여줬을 때, 정말 감동적이었어."},
{"speaker": "ai", "text": "그 순간의 감정을 상상할 수 있어요. 가족이 함께한 특별한 순간이었겠네요. 다른 기억에 남는 일도 있나요?"},
{"speaker": "user", "text": "네, 결혼식 날도 정말 기억에 남아요. 모든 사람들이 우리를 축복해주러 왔고, 정말 행복했어요."},
{"speaker": "ai", "text": "정말 아름다운 순간이었겠어요. 그날의 분위기는 어땠나요?"},
{"speaker": "user", "text": "모두가 웃고 즐기는 분위기였어요. 사랑하는 사람들과 함께해서 더욱 뜻깊었죠."},
{"speaker": "ai", "text": "사랑하는 사람들과의 시간은 언제나 특별하죠. 가족과 함께 보낸 또 다른 소중한 시간이 있을까요?"},
{"speaker": "user", "text": "아이들과 함께한 첫 가족 여행도 정말 잊을 수 없어요. 함께 해변에서 놀고, 저녁에는 바베큐를 했죠."},
{"speaker": "ai", "text": "가족 여행은 정말 좋은 추억을 만들기에 완벽한 순간이죠. 여행에서 가장 인상 깊었던 일은 무엇인가요?"},
{"speaker": "user", "text": "해변에서 아이들이 처음으로 파도를 만끽하는 모습을 본 것이에요. 그들의 웃음소리가 아직도 귀에 생생해요."},
]

# Generate and print the response
Expand Down

0 comments on commit ffbbb75

Please sign in to comment.