Skip to main content

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