Using the with statement
You can create a thread and execute code within it using the with statement:
thread method:
Thread API
Thread API
Manipulate threads directly using the API.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
with statementwith statement:
with client.thread() as thread:
# do something
thread method:
previous_thread_id = "UUID"
with client.thread(thread_id=previous_thread_id) as thread:
# do something
Was this page helpful?