# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .reasoning_config_effort import ReasoningConfigEffort
from .reasoning_config_summary import ReasoningConfigSummary


class ReasoningConfig(UniversalBaseModel):
    """
    Reasoning configuration for models that support extended thinking.

    Unified configuration that works across reasoning-capable models
    (OpenAI O-series, Anthropic Claude extended thinking).
    """

    effort: typing.Optional[ReasoningConfigEffort] = pydantic.Field(default=None)
    """
    Controls computational effort for reasoning. Higher effort produces more thorough analysis but increases response time and token usage. The API automatically maps effort levels to provider-specific parameters.
    """

    summary: typing.Optional[ReasoningConfigSummary] = pydantic.Field(default=None)
    """
    Controls reasoning summary formatting. 'off': raw reasoning (no formatting), 'auto': model decides, 'concise': brief overview, 'detailed': comprehensive explanation. Note: Claude ignores this field (no summary support). Use 'off' to explicitly disable formatting.
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
