tools_schema
Tools schema definitions for function calling adapters.
This module provides schemas for managing both standardized function tools and custom adapter-specific tools in the Pipecat framework.
- class pipecat.adapters.schemas.tools_schema.AdapterType(*values)[source]
Bases:
EnumSupported adapter types for custom tools.
- Parameters:
GEMINI – Google Gemini adapter.
OPENAI – OpenAI adapter (Chat Completions, Responses, and Realtime API).
- GEMINI = 'gemini'
- OPENAI = 'openai'
- class pipecat.adapters.schemas.tools_schema.ToolsSchema(standard_tools: Sequence[FunctionSchema | DirectFunction], custom_tools: dict[AdapterType, list[dict[str, Any]]] | None = None)[source]
Bases:
objectSchema for managing both standard and custom function calling tools.
This class provides a unified interface for handling standardized function schemas alongside custom tools that may not follow the standard format, such as adapter-specific search tools.
- __init__(standard_tools: Sequence[FunctionSchema | DirectFunction], custom_tools: dict[AdapterType, list[dict[str, Any]]] | None = None) None[source]
Initialize the tools schema.
- Parameters:
standard_tools – List of tools following the standardized FunctionSchema format.
custom_tools – Dictionary mapping adapter types to their custom tool definitions. These tools may not follow the FunctionSchema format (e.g., search_tool).
- property standard_tools: list[FunctionSchema]
Get the list of standard function schema tools.
- Returns:
List of tools following the FunctionSchema format.
- property custom_tools: dict[AdapterType, list[dict[str, Any]]] | None
Get the custom tools dictionary.
- Returns:
Dictionary mapping adapter types to their custom tool definitions.