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 |
|
@@ -224,8 +224,9 @@ def chat(message, history):
|
|
224 |
global assistant, thread
|
225 |
|
226 |
if assistant == None:
|
227 |
-
assistant = create_assistant(client) # on first run, create assistant and update assistant_id
|
228 |
-
|
|
|
229 |
|
230 |
if thread == None or len(history) == 0:
|
231 |
thread = create_thread(client)
|
|
|
24 |
|
25 |
client = OpenAI(api_key=os.environ.get("OPENAI_API_KEY"))
|
26 |
|
27 |
+
assistant_id = "asst_wkzK6kL4m2j7r5jljh5Yk6wa"
|
28 |
|
29 |
assistant, thread = None, None
|
30 |
|
|
|
224 |
global assistant, thread
|
225 |
|
226 |
if assistant == None:
|
227 |
+
#assistant = create_assistant(client) # on first run, create assistant and update assistant_id
|
228 |
+
# see https://platform.openai.com/playground/assistants
|
229 |
+
assistant = load_assistant(client) # on subsequent runs, load assistant
|
230 |
|
231 |
if thread == None or len(history) == 0:
|
232 |
thread = create_thread(client)
|