Tonic commited on
Commit
576f9f8
Β·
1 Parent(s): 8c73001

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -18,16 +18,19 @@ def ask_openai(question):
18
  )
19
  run = client.beta.threads.runs.create(
20
  thread_id=thread.id,
 
21
  )
22
  run = client.beta.threads.runs.retrieve(
23
  thread_id=thread.id,
24
  run_id=run.id
 
25
  )
26
 
27
  messages = client.beta.threads.messages.list(
28
  thread_id=thread.id
29
- )
30
 
 
31
  response = next((msg for msg in messages['data'] if msg['role'] == 'assistant'), None)
32
  return response['content'][0]['text']['value'] if response else "No response."
33
 
 
18
  )
19
  run = client.beta.threads.runs.create(
20
  thread_id=thread.id,
21
+ assistant_id=assistant_id
22
  )
23
  run = client.beta.threads.runs.retrieve(
24
  thread_id=thread.id,
25
  run_id=run.id
26
+ assistant_id=assistant_id
27
  )
28
 
29
  messages = client.beta.threads.messages.list(
30
  thread_id=thread.id
31
+ assistant_id=assistant_id
32
 
33
+ )
34
  response = next((msg for msg in messages['data'] if msg['role'] == 'assistant'), None)
35
  return response['content'][0]['text']['value'] if response else "No response."
36