Week 1 · Day 3 of 10
Tools: letting the model act
Students can give a model tools, handle what happens when a tool fails, and gate risky actions behind a human.
1LearnFunction calling with real APIs
How a model decides to call a function, turning Python functions into tool schemas with Pydantic, calling real APIs, handling tool errors, and asking a human to approve risky actions before they run.
How a tool call works
- You ask
Try it live
Try it live
Watch a model call real tools
The model has two tools: a live weather API and a calculator. The trace shows each call it asks for and what came back.
Check your understanding
In tool calling, who actually runs the tool?
A tool call times out. What's the best way to handle it?
When should a human approve a tool call before it runs?
2BuildOne tool that reads, one that acts
Watch Robert add two tools first, one short clip per step, then do each step yourself: one that reads (live exchange rates) and one that acts (saves a job), with a human approving the save.
Done when: the model looks something up and, once you approve, saves a record.
1 Give your agent the spec
Done when main.py has a convert_currency tool and a save_job tool.
2 Watch it read
Done when a GBP salary comes back in US dollars.
- Recording coming soon
3 Approve the action
Done when you approve the save, and the job is in jobs.json.
- Recording coming soon
4 Push to deploy
Done when both tools work on your public link.
3CapstoneFirst tool on real data
First tool wired to real data.
4HomeworkConnect a public API
Find a public API your users would want and connect it.
For teachers: the day 3 teaching kit.