Skip to content

Commit

Permalink
Update discordbot.py
Browse files Browse the repository at this point in the history
  • Loading branch information
AzelT3T authored Jun 29, 2023
1 parent 1bb6f4c commit aa61a5c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion discordbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def check_with_openai(question):
openai.api_key = openai_api_key
matched_questions = []
for faq_question in faq.keys():
#prompt = f"{question}という質問がありましたが、これは '{faq_question}' の質問と一致しますか?あなたの回答は 'yes' または 'no' を指定してください。"
prompt = f"user asked a question called '{question}', does this match the question '{faq_question}'? Your answer should be 'yes' or 'no' only."

completion = openai.ChatCompletion.create(
Expand All @@ -35,7 +36,8 @@ def check_with_openai(question):
matched_questions.append(faq_question)

if len(matched_questions) > 1:
prompt = f"次の質問の中で、ユーザーの質問 '{question}' に最も一致しているのはどれですか? {', '.join(matched_questions)}"
#prompt = f"次の質問の中で、ユーザーの質問 '{question}' に最も一致しているのはどれですか? {', '.join(matched_questions)}"
prompt = f"'{', '.join(matched_questions)}' that best matches the user's question'{question}'?"
completion = openai.ChatCompletion.create(
model="gpt-3.5-turbo",
messages=[
Expand Down

0 comments on commit aa61a5c

Please sign in to comment.