Tools and bind_tools
A model can only ask for tools it has been told about. See how a Python function becomes a tool, what bind_tools sends to the model, and how every tool call is matched to its result, even when two run at once.
10 minPro
Checking your access…
Inside this lesson
- An animation you play, pause and step through, with each part saying what it is doing.
- The real code beside it, with the lines for each step lit up.
- Practice mode, where you route each message yourself, and a short quiz.
- About 10 minutes.
In this module: Models, tools and agents
- Chat models and messagesinit_chat_model, message types, content blocks and tool calls.Pro
- Tools and bind_toolsDefine tools, bind them to a model and run them with ToolNode.Pro
- Tools that read state and storeToolRuntime gives tools state, context, store and a stream writer.Pro
- Structured outputGet typed results with provider or tool calling strategies.Pro
- The agent loop as a graphModel node, tool node and one conditional edge that loops.Pro
- The prebuilt agent: create_agentA ready made agent graph you shape with middleware.Pro