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
Creating Well-Structured Function Definitions
Creating Well-Structured Function Definitions
When defining functions, you need to provide:
- name: The function name
- description: What the function does
- parameters: JSON Schema object describing the parameters
Supported Parameter Types for Function Arguments
Supported Parameter Types for Function Arguments
Functions support various parameter types:
Implementation Workflows
Working with Multiple Function Definitions
Working with Multiple Function Definitions
Define multiple functions for the model to choose from:
Processing and Responding to Function Calls
Processing and Responding to Function Calls
Process function calls and continue the conversation:
Controlling When and How Functions Are Called
Controlling When and How Functions Are Called
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 athought_signature field in tool call responses.