-
Notifications
You must be signed in to change notification settings - Fork 333
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
Stream api #392
Comments
Looked in the code a bit. One approach is to have streaming versions of the provider calls. This makes it clear we should be streaming all the way through. separate code paths for streaming in complex and or track may help too. There’s a clear spot to branch on track vs track_streaming for example if that helps us. How should the api should surface at the user level? Eg Stream as a value returned by an lmp when stream is true as a property of whatever result type… (nonstreaming is list[Message] for c in result.stream(): Other approaches: |
Regarding ergonomics of programming libraries, I liked approach taken by
function ( example : https://github.com/jeremychone/rust-genai/blob/d79f0f03c68c3af1c5638c3589469653eefd5edb/examples/c04-chat-options.rs#L41 ). As often we would like to receive object/functor/iterator capable of iterating over chunks, but displaying them in terminal while prototyping all the time is just against DRY. So I find that libraries should also provide some ergonomic routine to print to stdout/stderr... basically sth like normal |
A couple users have asked about a streaming api. Specifically a way to receive chunked output for text blocks and structured output.
How to make this work with tracking?
The text was updated successfully, but these errors were encountered: