Open
Description
Discussed in #3387
Originally posted by sand-heap February 11, 2025
Pretty much what the title says. I can explain further with code
...
@dataclass
class InputState:
some_field: int
class OverAllState(messages):
some_field: int
def validate_transition(state: OverallState)->List:
if state.get("some_field") == 1:
return END
else:
return "other_node"
def some_node(input: InputState)->OverAllState:
return {"some_field": input.some_field+1}
workflow = StateGraph(OverAllState, input=InputState)
workflow.set_entry_point("node")
workflow.add("node", some_node)
workflow.add("other_node", other_node)
workflow.add_conditional_edges("node", validate_transition,...)
...
# add end
...
I would expect the validate_transition
to receive the OverallState
but for some reason it gets the InputState
?!
However if i add a mock_node
between node
and other_node
and make the edge from mock_node
conditional instead and have a sequential flow from node
-> mock_node
, the behavour is as expected.
can you please help? ++ @vbarda @hinthornw
Activity