bstraehle commited on
Commit
08d4fbd
·
verified ·
1 Parent(s): 0200702

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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,