def should_continue()

in 0_basic-agent/LangGraph/my_agent/utils/nodes.py [0:0]


def should_continue(state):
    messages = state["messages"]
    last_message = messages[-1]
    # If there are no tool calls, then we finish
    if not last_message.tool_calls:
        return "end"
    # Otherwise if there is, we continue
    else:
        return "continue"