Stream Batch Events
#20235
Replies: 2 comments
-
Hi @eyurtsev, would love to get your feedback on whether or not this idea makes sense, since you did such a fantastic job on the original astream_events implementation. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I would love to have this functionality! |
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Checked
Feature request
Extend the astream_events runnable method (https://python.langchain.com/docs/modules/agents/how_to/streaming/#custom-streaming-with-events)
to something like
astream_batch_events
, which accepts inputs rather than an input.Motivation
This would help me run the same chain on batches of inputs where I rely on getting intermediate steps as metadata. It also feels like a natural extension considering we have
invoke(input={})
andbatch(inputs=[{}])
interfaces.Proposal (If applicable)
I would propose that a new interface that serves as a wrapper to astream_events be created (i.e.
astream_batch_events
). This wrapper would be the same asastream_events
, except:inputs:list[dict]
rather thaninput:dict
input_id_attr
which would allow users to determine the originating input object from a list of streamed events. The example below should help.Extending this example of a astream_events run:
slightly modified from source, to use a dict as an input instead of a str
I might expect to see something like this from
astream_batch_events
:Beta Was this translation helpful? Give feedback.
All reactions