Skip to main content

Overview

Function calling lets you define tools that the model can invoke. When the model decides to call a tool, it returns a structured JSON response that you execute in your application and feed back to the model.

Basic Example

Multi-Step Tool Use

After receiving a tool call, execute it and send the result back:

tool_choice Options