Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -37,7 +37,7 @@ def chat(message, history, openai_api_key):
|
|
37 |
|
38 |
global assistant, thread
|
39 |
|
40 |
-
if get_openai_client() == None:
|
41 |
set_openai_client(openai_api_key)
|
42 |
|
43 |
# On first run, create assistant and update assistant_id,
|
|
|
37 |
|
38 |
global assistant, thread
|
39 |
|
40 |
+
if get_openai_client() == None or len(history) == 0:
|
41 |
set_openai_client(openai_api_key)
|
42 |
|
43 |
# On first run, create assistant and update assistant_id,
|