Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -31,8 +31,10 @@ def respond(openai_apikey, chat_history):
|
|
31 |
messages=re_messages,
|
32 |
temperature=0.7
|
33 |
)
|
34 |
-
|
35 |
-
|
|
|
|
|
36 |
for re_chunk in re_chat_completion.choices:
|
37 |
chat_history[-1][1] += re_chunk.delta.get("content", "")
|
38 |
|
|
|
31 |
messages=re_messages,
|
32 |
temperature=0.7
|
33 |
)
|
34 |
+
if not chat_history:
|
35 |
+
chat_history.apend([','])
|
36 |
+
if chat_history[-1][1] is None:
|
37 |
+
chat_history[-1][1] = ""
|
38 |
for re_chunk in re_chat_completion.choices:
|
39 |
chat_history[-1][1] += re_chunk.delta.get("content", "")
|
40 |
|