Slightly modified examples from langgraph, all graph code for nodes/edges generated.
Nodes mostly unchanged, take 'state' parameter.
Conditional edges simplified, edge traversal determined by boolean function that takes 'state' as parameter.
graph_spec = """
call_model(AgentState)
no_tools => END
=> call_tool
call_tool
=> call_model
"""
graph_spec = """
call_model(MessagesState, memory)
no_tools => END
human_needed => get_human_input
=> tool_node
tool_node
=> call_model
get_human_input
=> call_model
"""
graph_spec = """
call_model(AgentState)
should_call_tool => ask_human_approval
ask_human_approval
human_allows_tool_call => call_tool
call_tool
=> call_model
"""