Programmatic streaming now supported with for partial in program(stream=True)
#129
slundberg
announced in
Announcements
Replies: 2 comments
-
It works perfectly, thanks @slundberg ! Do you also plan to support the update of the internal program conversation "history" ( program.text ), as it happens without streaming? program = program(stream=False, silent=True) # this updates the conversation history internally |
Beta Was this translation helpful? Give feedback.
0 replies
-
AttributeError: module 'guidance' has no attribute 'llms' @slundberg |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Guidance now supports the convenient streaming of partial results programmatically (before it was just streamed to the notebook for display).
Here is an example of synchronous streaming
Here is an example of asynchronous streaming (run in a notebook event loop)
Here is an example of tracking just the new content
How does it work?
It returns a reference to the partially completed program object at the same refresh rate used for notebook display streaming. If you want to get just the difference of what might be new, you can track the current position in whatever variable of interest yourself during the loop.
Caveats
Since this is a new feature I expect we will need to update some of the library functions to set variable values more frequently so they stream nicer. If you run into a scenario like this post an issue (or a PR!).
Beta Was this translation helpful? Give feedback.
All reactions