Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: assistant streaming #319

Open
rnewman opened this issue Apr 9, 2024 · 0 comments
Open

Feature request: assistant streaming #319

rnewman opened this issue Apr 9, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@rnewman
Copy link

rnewman commented Apr 9, 2024

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:

with client.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(),
) as stream:
  stream.until_done()

Problem it Solves

Writing a polling-based assistant client is awkward and slow.

@rnewman rnewman added the enhancement New feature or request label Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant