10.02

Function tools and hosted tools

skillmaxingPython with AIFunction tools and hosted tools
Visual lesson

Function tools and hosted tools

Included with Pro · 4:20
Lessons · 1,115 words

In lesson 09.02 you built a tool by writing a Pydantic model, extracting its JSON Schema, wrapping it in a dict, and writing a dispatcher to route calls by name. The Agents SDK collapses all of that into one decorator on an ordinary function. The type hints become the schema, the docstring becomes the description, and the runner does the dispatching and the validation. What you learned about naming, descriptions, and short results applies unchanged; only the boilerplate is gone.

There is a second kind of tool that runs on OpenAI's side rather than yours: hosted tools such as web search, file search, and a code interpreter. And there is a third pattern, an agent used as a tool by another agent, which is the small-scale version of the multi-agent systems in lesson 10.03.

Pro

Continue reading

Pro unlocks every video lesson, the full notes and runnable code across the Python with AI course, from the language itself to agents, MCP, Langfuse and deployment.

Unlock full access to
Python with AIAI researchComplete system design
30% off with LAUNCH30ends in 7h 40m
Buy now
View all plans ·Already Pro? Sign in
124 online