Replies: 1 comment 4 replies
-
There's a parameter (that we need to rename) on add_routes: stream_log_name_allow_list: Optional[Sequence[str]] = None You specify it on the server side and it will only include events from runnables with a matching run name. You may need to name the runnables in your config my_runnable.with_config({'run_name': 'meow'}) Alternatively, the client itself can provide filtering parameters (take a look at the astream_events API documentation in langchain) -- but only use this strategy for internal tools etc. If it's exposed via a web-service to untrusted users, those users will be able to use the endpoint to ask for additional data Please note that this strategy is also useful to deal with serialization issues if intermediate steps in the overall chain return non-serializable outputs |
Beta Was this translation helpful? Give feedback.
-
hi,
Say I have a very simple chain, that the first runnable produced a huge output (like all text from a huge pdf) and then send to
LLM
for summarize, and finally return summarized content to client side.The client side are using
stream event
to get progress running info reported from server for better UX, as I can see, every client side received event has the intput and output data, that would be a perf problem or unnecessary for my case especially for that huge text output:I read the https://python.langchain.com/docs/expression_language/streaming#filtering-events seems the mininal control granularity is runnable.
How can I just disable the
data
for specific runnable while keep its event? sth like:Beta Was this translation helpful? Give feedback.
All reactions