-
Notifications
You must be signed in to change notification settings - Fork 175
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
Add events util #1480
base: main
Are you sure you want to change the base?
Add events util #1480
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
0f2efa3
to
c84a945
Compare
c84a945
to
7301a5a
Compare
7301a5a
to
83685e9
Compare
83685e9
to
c5b03a9
Compare
## Stream Iterator | ||
|
||
You can use `Structure.run_stream()` for streaming Events from the `Structure` in the form of an iterator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would prefer a EventStream
util like Stream
that currently exists and punt more core API changes to the Structure api to a later time, but not going to block the PR based on that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The downside of this approach is that EventStream
would need to support anything that might need this functionality (Structures, Tasks, Drivers, Tools, etc).
I'm just as nervous about modifying Structure
's API, but this implementation does at least seem consistent with other similar frameworks.
|
||
!!! tip | ||
|
||
Set `stream=True` on your [Prompt Driver](../drivers/prompt-drivers.md) in order to receive completion chunk events. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would love to see this requirement be inferred based on Structure usage rather than needing it to be set in the constructor. Obviously out of scope, but writing it down until I have time to fill out an issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, we need a better way for framework components to broadcast that they publish stream-like events.
Describe your changes
Added
Structure.run_stream()
for streaming Events from a Structure as an iterator.Issue ticket number and link
Closes #1479