Update app.py

This commit is contained in:
Alex
2023-05-31 23:49:41 +01:00
parent f8910ba136
commit 3f88b04c4a

View File

@@ -169,7 +169,8 @@ def complete_stream(question, docsearch, chat_history, api_key):
messages_combine.append({"role": "user", "content": i["prompt"]})
messages_combine.append({"role": "system", "content": i["response"]})
messages_combine.append({"role": "user", "content": question})
completion = openai.ChatCompletion.create(model="gpt-3.5-turbo", messages=messages_combine, stream=True, max_tokens=1000, temperature=0)
completion = openai.ChatCompletion.create(model="gpt-3.5-turbo",
messages=messages_combine, stream=True, max_tokens=1000, temperature=0)
for line in completion:
if 'content' in line['choices'][0]['delta']: