langgraph/how-tos/command/ #2654
Replies: 8 comments 11 replies
-
Hey, I'm encountering some issues with implementing "Command". My goal is to iterate through a list of objects. For each object that I classify as "yes," I want to return it to the user (edge END?) while, at the same time, allowing the graph to continue classifying the remaining objects. Within the loop, I have conditions to check whether I have classified enough objects and whether I have classified enough "yes" responses. Thanks, |
Beta Was this translation helpful? Give feedback.
-
I am having issues with using Command, im getting the following error: TypeError: Command.init() got an unexpected keyword argument 'goto' Am I doing something wrong? Thanks, |
Beta Was this translation helpful? Give feedback.
-
Is this meant to replace SEND? Or be more of an augmentation to be able to map reduce while updating state. Should commands replace conditional edges? |
Beta Was this translation helpful? Give feedback.
-
I think here the output should be {'foo': 'ab'} right? because inside the node A the graph state will get updated to {'foo': 'a'} and then it will navigate to b where the state gets updated to {'foo': 'ab'}. |
Beta Was this translation helpful? Give feedback.
-
How a ToolNode should use Command? |
Beta Was this translation helpful? Give feedback.
-
Could you do a tutorial for an assistant that prompt's a user's feedback many times in the workflow and at different nodes? |
Beta Was this translation helpful? Give feedback.
-
Nodes b and c can also be written like this right? def node_c(state: State): |
Beta Was this translation helpful? Give feedback.
-
I was trying a class based node, but unable to see edges when I do this is my class based node definition class MyNode(AbastractClassWithRunMethodOnly)
def run(self, state, *args) -> Command[Literal['node2', END]]:
# my logic
return Command(goto='node2')
# has graph obj
my_node_obj = MyNode()
graph.add_node(my_node_obj.run) this way I'm not able to see the edges . |
Beta Was this translation helpful? Give feedback.
-
langgraph/how-tos/command/
Build language agents as graphs
https://langchain-ai.github.io/langgraph/how-tos/command/
Beta Was this translation helpful? Give feedback.
All reactions