Skip to main content

馃憪 Define graph nodes

Let's define the nodes of our graph. Our agent will have two nodes- an agent node and a tool node.

Fill in any <CODE_BLOCK_N> placeholders and run the cells under the Step 8: Define graph nodes section in the notebook to define the nodes of the graph.

The answers for code blocks in this section are as follows:

CODE_BLOCK_14

Answer
state["messages"]

CODE_BLOCK_15

Answer
llm_with_tools.invoke(messages)

CODE_BLOCK_16

Answer
tool.invoke(tool_call["args"])