Skip to main content
Function calling allows models to invoke defined functions during conversations, enabling them to perform specific actions or retrieve information from external sources.

Basic Usage

Define functions that the model can call:

Function Definition Schema

When defining functions, you need to provide:
  • name: The function name
  • description: What the function does
  • parameters: JSON Schema object describing the parameters
Functions support various parameter types:

Complete Workflow

Define multiple functions for the model to choose from:
Process function calls and continue the conversation:
Control when and how functions are called: