Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -25,12 +25,10 @@ def ask_openai(question):
|
|
25 |
run = client.beta.threads.runs.retrieve(
|
26 |
thread_id=thread.id,
|
27 |
run_id=run.id,
|
28 |
-
assistant_id=assistant_id
|
29 |
)
|
30 |
|
31 |
messages = client.beta.threads.messages.list(
|
32 |
thread_id=thread.id,
|
33 |
-
assistant_id=assistant_id
|
34 |
)
|
35 |
response = next((msg for msg in messages['data'] if msg['role'] == 'assistant'), None)
|
36 |
return response['content'][0]['text']['value'] if response else "No response."
|
|
|
25 |
run = client.beta.threads.runs.retrieve(
|
26 |
thread_id=thread.id,
|
27 |
run_id=run.id,
|
|
|
28 |
)
|
29 |
|
30 |
messages = client.beta.threads.messages.list(
|
31 |
thread_id=thread.id,
|
|
|
32 |
)
|
33 |
response = next((msg for msg in messages['data'] if msg['role'] == 'assistant'), None)
|
34 |
return response['content'][0]['text']['value'] if response else "No response."
|