Add return_keys parameter to Send #3951
nick-youngblut
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Feature request
It would be helpful to filter the returned state from Send to certain state variables (e.g., just messages) versus having to return the entire state for each sub-workflow called by Send.
This merging of the returned values from
Send
into the parent graph state can lead to errors such as:langgraph.errors.InvalidUpdateError: At key 'MY_KEY': Can receive only one value per step. Use an Annotated key to handle multiple values.
TypeError: can only concatenate list (not "str") to list
ifMY_KEY: Annotated[List[str], operator.add]
is used in the parent graph stateMY_KEY
a string, and then I will just get a concatenated string (not optimal), or I have to edit all of my sub-workflow code so thatMY_KEY
is a list of strings instead of just a stringMotivation
While there is probably an existing way to filter the state returned from each Send call, the docs do not describe this.
Including such a filtering parameter directly in Send would make it easy for anyone to quickly filter the returned state from each sub-workflow.
Beta Was this translation helpful? Give feedback.
All reactions