name
and birthday
keys to the state:
human_assistance
tool. This allows a human to review the information before it is stored in the state. Use Command
to issue a state update from inside the tool.
human_assistance
tool once it has the required information. By setting name
and birthday
in the arguments for the tool, you force the chatbot to generate proposals for these fields.
interrupt
in the human_assistance
tool again.
graph.update_state
:
graph.get_state
, you can see the new value is reflected:
interrupt
function is generally recommended instead, as it allows data to be transmitted in a human-in-the-loop interaction independently of state updates.
Congratulations! You’ve added custom keys to the state to facilitate a more complex workflow, and learned how to generate state updates from inside tools.
Check out the code snippet below to review the graph from this tutorial:
checkpointing
and state updates
to time travel.