Skip to content

supports_json_schema_output and some other profile settings should be provider settings #3384

@xcpky

Description

@xcpky

Initial Checks

Description

supports_json_schema_output: bool = False
"""Whether the model supports JSON schema output."""
supports_json_object_output: bool = False
"""Whether the model supports JSON object output."""
default_structured_output_mode: StructuredOutputMode = 'tool'
"""The default structured output mode to use for the model."""
prompted_output_template: str = dedent(
    """
    Always respond with a JSON object that's compatible with this schema:

    {schema}

    Don't include any text or Markdown fencing before or after.
    """
)
"""The instructions template to use for prompted structured output. The '{schema}' placeholder will be replaced with the JSON schema for the output."""
json_schema_transformer: type[JsonSchemaTransformer] | None = None
"""The transformer to use to make JSON schemas for tools and structured output compatible with the model."""

ModelProfile Describes how requests to and responses from specific models or families of models need to be constructed and processed to get the best results, independent of the model and provider classes used.

The above fields of ModelProfile are not model-specific, but provider-specific. They should be categorized as provider settings. For example, there are a bunch of providers for deepseek v3.2, which have different support for json schema and json object.

Example Code

Python, Pydantic AI & LLM client version

Python 3.13
pydantic_ai 1.12.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions