# 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 .think_settings_v1context_length import ThinkSettingsV1ContextLength
from .think_settings_v1endpoint import ThinkSettingsV1Endpoint
from .think_settings_v1functions_item import ThinkSettingsV1FunctionsItem
from .think_settings_v1provider import ThinkSettingsV1Provider


class ThinkSettingsV1(UniversalBaseModel):
    provider: ThinkSettingsV1Provider
    endpoint: typing.Optional[ThinkSettingsV1Endpoint] = pydantic.Field(default=None)
    """
    Optional for non-Deepgram LLM providers. When present, must include url field and headers object
    """

    functions: typing.Optional[typing.List[ThinkSettingsV1FunctionsItem]] = None
    prompt: typing.Optional[str] = None
    context_length: typing.Optional[ThinkSettingsV1ContextLength] = pydantic.Field(default=None)
    """
    Specifies the number of characters retained in context between user messages, agent responses, and function calls. This setting is only configurable when a custom think endpoint is used
    """

    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
