pydantic_ai.models.mcp_sampling
Bases: ModelSettings
Settings used for an MCP Sampling model request.
Model preferences to use for MCP Sampling.
Type: ModelPreferences
Bases: Model
A model that uses MCP Sampling.
MCP Sampling allows an MCP server to make requests to a model by calling back to the MCP client that connected to it.
The MCP server session to use for sampling.
Type: ServerSession
Default max tokens to use if not set in ModelSettings.
Max tokens is a required parameter for MCP Sampling, but optional on
ModelSettings, so this value is used as fallback.
Type: int Default: 16384
The model name.
Since the model name isn’t known until the request is made, this property always returns 'mcp-sampling'.
Type: str
The system / model provider, returns 'MCP'.
Type: str