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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .thinking_type import ThinkingType


class Thinking(UncheckedBaseModel):
    """
    Configuration for [reasoning features](https://docs.cohere.com/docs/reasoning).
    """

    type: ThinkingType = pydantic.Field()
    """
    Reasoning is enabled by default for models that support it, but can be turned off by setting `"type": "disabled"`.
    """

    token_budget: typing.Optional[int] = pydantic.Field(default=None)
    """
    The maximum number of tokens the model can use for thinking, which must be set to a positive integer.
    The model will stop thinking if it reaches the thinking token budget and will proceed with the response.
    """

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

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