bstraehle commited on
Commit
37a1f88
1 Parent(s): 18eed82

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -33,13 +33,15 @@ def chat(message, history):
33
  #raise gr.Error("Please clone and bring your own OpenAI and Tavily credentials.")
34
 
35
  global assistant, thread
36
-
 
 
 
37
  if assistant == None:
38
- #assistant = create_assistant(openai_client) # on first run, create assistant and update assistant_id
39
- # see https://platform.openai.com/playground/assistants
40
- assistant = load_assistant(openai_client) # on subsequent runs, load assistant
41
 
42
- # TODO: Gradio session / multi-user thread
43
  if thread == None or len(history) == 0:
44
  thread = create_thread(openai_client)
45
 
 
33
  #raise gr.Error("Please clone and bring your own OpenAI and Tavily credentials.")
34
 
35
  global assistant, thread
36
+
37
+ # On first run, create assistant and update assistant_id,
38
+ # see https://platform.openai.com/playground/assistants.
39
+ # On subsequent runs, load assistant.
40
  if assistant == None:
41
+ #assistant = create_assistant(openai_client)
42
+ assistant = load_assistant(openai_client)
 
43
 
44
+ # TODO: Use Gradio session to support multiple users
45
  if thread == None or len(history) == 0:
46
  thread = create_thread(openai_client)
47