Spaces:
Running
Running
Update app.py
Browse files
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)
|
39 |
-
|
40 |
-
assistant = load_assistant(openai_client) # on subsequent runs, load assistant
|
41 |
|
42 |
-
# TODO: Gradio session
|
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 |
|