Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -54,9 +54,11 @@ def chatbot(input, choice):
|
|
54 |
try:
|
55 |
if input and choice!='联网增强模式':
|
56 |
print('start the NO internet version of ChatGPT')
|
57 |
-
|
58 |
-
#
|
59 |
-
{"role": "system", "content": "
|
|
|
|
|
60 |
messages.append({"role": "user", "content": input})
|
61 |
for resp in openai.ChatCompletion.create(model="gpt-3.5-turbo", messages=messages, stream=True, max_tokens=2048,temperature=0.9):
|
62 |
answer = str(resp['choices'][0]['delta'].get('content'))
|
|
|
54 |
try:
|
55 |
if input and choice!='联网增强模式':
|
56 |
print('start the NO internet version of ChatGPT')
|
57 |
+
|
58 |
+
# messages = [
|
59 |
+
# # {"role": "system", "content": "You are a helpful and kind AI Assistant."},
|
60 |
+
# {"role": "system", "content": "你是一个专业和友好的AI助手。"},] ## 这里可以开关memory,history功能。
|
61 |
+
|
62 |
messages.append({"role": "user", "content": input})
|
63 |
for resp in openai.ChatCompletion.create(model="gpt-3.5-turbo", messages=messages, stream=True, max_tokens=2048,temperature=0.9):
|
64 |
answer = str(resp['choices'][0]['delta'].get('content'))
|