Hi
The client.beta.threads.runs.retrieve() method takes minimum 8 seconds to answer the question.
Below is the code snippet.
Please note, as a knowledge base, I have pdf file of 100 mb of textual information.
while True:
run = client.beta.threads.runs.retrieve(thread_id=thread_id, run_id=run_id, timeout=5.0)
print('status: ', run.status)
if run.status == “completed”:
messages = client.beta.threads.messages.list(thread_id=thread_id)
latest_message = messages.data[0]
text = latest_message.content[0].text.valueexit_time = time.time() loop_time = exit_time - enter_time print(f'Loop time: {loop_time} seconds') break