We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This should probably be a different exception -- we're just returning the wrong thing (the subgraph instead of the return value from the subgraph)
import uuid from typing import TypedDict, Optional from langgraph.graph import StateGraph from langgraph.constants import START from langgraph.checkpoint.memory import MemorySaver class State(TypedDict): """The graph state.""" state_counter: int def child_node(state: State): return state subgraph_builder = StateGraph(State) subgraph_builder.add_node("child_node", child_node) subgraph_builder.add_edge(START, "child_node") subgraph = subgraph_builder.compile() def parent_node(state: State): """This parent node will invoke the subgraph.""" subgraph_state = subgraph.invoke(state) return subgraph # <--- THIS IS THE BUG IN USER CODE (typo), exception claims multiple subgraph calls (based on ast parsing?) checkpointer = MemorySaver() builder = StateGraph(State) builder.add_node("parent_node", parent_node) builder.add_edge(START, "parent_node") # A checkpointer must be enabled for interrupts to work! checkpointer = MemorySaver() graph = builder.compile(checkpointer=checkpointer) config = { "configurable": { "thread_id": uuid.uuid4(), } } for chunk in graph.stream({"state_counter": 1}, config): print(chunk)
The text was updated successfully, but these errors were encountered:
@eyurtsev Since the code now returns subgraph_state instead of state, it seems the issue is resolved. Let me know if I'm misunderstanding something
Sorry, something went wrong.
No branches or pull requests
Privileged issue
Issue Content
This should probably be a different exception -- we're just returning the wrong thing (the subgraph instead of the return value from the subgraph)
The text was updated successfully, but these errors were encountered: