You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
so you can stream and handle events from a run without polling:
withclient.beta.threads.runs.stream(
thread_id=thread.id,
assistant_id=assistant.id,
instructions="Please address the user as Jane Doe. The user has a premium account.",
event_handler=EventHandler(),
) asstream:
stream.until_done()
Problem it Solves
Writing a polling-based assistant client is awkward and slow.
The text was updated successfully, but these errors were encountered:
Feature Description
The OpenAI API recently added events for the beta Assistant feature:
https://platform.openai.com/docs/api-reference/assistants-streaming/events
The official Python SDK uses this to offer a streaming interface:
https://platform.openai.com/docs/assistants/overview?lang=python&context=with-streaming
so you can stream and handle events from a run without polling:
Problem it Solves
Writing a polling-based assistant client is awkward and slow.
The text was updated successfully, but these errors were encountered: