Tool Calling (Function Calling)
Let the model call your functions to get real-time data or perform actions.Defining Tools
Tools are defined using JSON Schema:Tool Call Flow
Response with Tool Calls
When the model wants to call a tool:Sending Tool Results
After executing the tool, send the result:Complete Example
See Also
- examples/03_tool_calling.py - Single tool example
- examples/05_multi_turn_tools.py - Sequential tools
- examples/06_parallel_tools.py - Parallel tools