Skip to main content

Function Calling

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

Basic Usage

Define functions that the model can call:

Function Definition Reference

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:

Implementation Workflows

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

Thought Signatures

Thought signatures are encrypted representations of a model’s internal reasoning process that help maintain context and coherence across multi-turn interactions, particularly during function calling. When using certain Gemini 3 preview models, the API includes a thought_signature field in tool call responses.