Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pydantic_ai_slim/pydantic_ai/profiles/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import re
from dataclasses import dataclass
from functools import lru_cache
from typing import Any

from . import ModelProfile
Expand All @@ -28,6 +29,10 @@ def openai_model_profile(model_name: str) -> ModelProfile:
# Structured Outputs (output mode 'native') is only supported with the gpt-4o-mini, gpt-4o-mini-2024-07-18, and gpt-4o-2024-08-06 model snapshots and later.
# We leave it in here for all models because the `default_structured_output_mode` is `'tool'`, so `native` is only used
# when the user specifically uses the `NativeOutput` marker, so an error from the API is acceptable.
return _get_openai_model_profile(is_reasoning_model)

@lru_cache(maxsize=2)
def _get_openai_model_profile(is_reasoning_model: bool) -> ModelProfile:
return OpenAIModelProfile(
json_schema_transformer=OpenAIJsonSchemaTransformer,
supports_json_schema_output=True,
Expand Down
Loading