Chapter 12 · Tools, agents and harnesses
Tool use and function calling
A model can ask the software around it to run a tool (search, calculator, code) and read the result.
Chapter 12 · Tools, agents and harnesses
A model can ask the software around it to run a tool (search, calculator, code) and read the result.
The model gets a question it cannot do reliably in its head.
The model never runs the calculator. It asks, the app runs it, and the answer is handed back.
A model predicts likely text. For “4821 times 379” it may produce a number that looks right but is not.
Ask a question and press Next step to reveal the exchange one message at a time. Notice when the model asks for the tool and when it does not. Then turn the calculator off.
The model asks, the app acts. That split keeps the model's reach under the app's control. This model is a few scripted rules that spot arithmetic; real models learn when to call a tool.
Who actually runs the calculator?
Why is a calculator tool useful?
What happens to the tool's result?