Spaces:
Paused
Paused
Commit
·
a95a511
1
Parent(s):
ecbc623
Update bot/chatgpt/chat_gpt_bot.py
Browse files
bot/chatgpt/chat_gpt_bot.py
CHANGED
@@ -42,7 +42,7 @@ class ChatGPTBot(Bot):
|
|
42 |
def reply_text(self, query, user_id, retry_count=0):
|
43 |
try:
|
44 |
response = openai.ChatCompletion.create(
|
45 |
-
model="gpt-3.5-turbo
|
46 |
messages=query,
|
47 |
stream=True,
|
48 |
temperature=1, # 值在[0,1]之间,越大表示回复越具有不确定性
|
@@ -52,7 +52,7 @@ class ChatGPTBot(Bot):
|
|
52 |
presence_penalty=0, # [-2,2]之间,该值越大则更倾向于产生不同的内容
|
53 |
)
|
54 |
res_content = response.choices[0]['text'].strip().replace('<|endoftext|>', '')
|
55 |
-
logger.info(response.choices[0]['message']['content'])
|
56 |
log.info("[OPEN_AI] reply={}".format(res_content))
|
57 |
return response.choices[0]['message']['content']
|
58 |
except openai.error.RateLimitError as e:
|
|
|
42 |
def reply_text(self, query, user_id, retry_count=0):
|
43 |
try:
|
44 |
response = openai.ChatCompletion.create(
|
45 |
+
model="gpt-3.5-turbo", # 对话模型的名称
|
46 |
messages=query,
|
47 |
stream=True,
|
48 |
temperature=1, # 值在[0,1]之间,越大表示回复越具有不确定性
|
|
|
52 |
presence_penalty=0, # [-2,2]之间,该值越大则更倾向于产生不同的内容
|
53 |
)
|
54 |
res_content = response.choices[0]['text'].strip().replace('<|endoftext|>', '')
|
55 |
+
# logger.info(response.choices[0]['message']['content'])
|
56 |
log.info("[OPEN_AI] reply={}".format(res_content))
|
57 |
return response.choices[0]['message']['content']
|
58 |
except openai.error.RateLimitError as e:
|