Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -24,7 +24,7 @@ from utils import function_to_schema, show_json
|
|
24 |
|
25 |
client = OpenAI(api_key=os.environ.get("OPENAI_API_KEY"))
|
26 |
|
27 |
-
assistant_id = "
|
28 |
|
29 |
assistant, thread = None, None
|
30 |
|
@@ -223,7 +223,8 @@ def chat(message, history):
|
|
223 |
global assistant, thread
|
224 |
|
225 |
if assistant == None:
|
226 |
-
assistant = create_assistant(client)
|
|
|
227 |
|
228 |
if thread == None or len(history) == 0:
|
229 |
thread = create_thread(client)
|
|
|
24 |
|
25 |
client = OpenAI(api_key=os.environ.get("OPENAI_API_KEY"))
|
26 |
|
27 |
+
assistant_id = "asst_CJxGHbFQZADs2uUC2bxuvb7Z"
|
28 |
|
29 |
assistant, thread = None, None
|
30 |
|
|
|
223 |
global assistant, thread
|
224 |
|
225 |
if assistant == None:
|
226 |
+
#assistant = create_assistant(client) # on first run, create assistant and update assistant_id (see https://platform.openai.com/playground/assistants)
|
227 |
+
assistant = load_assistant(client) # on subsequent runs, load assistant
|
228 |
|
229 |
if thread == None or len(history) == 0:
|
230 |
thread = create_thread(client)
|