# 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 .agent_config_model import AgentConfigModel


class AgentConfig(UncheckedBaseModel):
    """
    Optional agent configuration overrides.

    Product faces send only the fields they want to override.
    Omitted fields (None) use platform defaults.

    The model field accepts a single model name or an ordered list.
    If a list, the first entry is the primary model and the rest are
    fallbacks tried in order if the primary fails. Model provider
    (Anthropic, OpenAI, Google) is derived automatically from the
    model name.

    Platform defaults:
    - model: "claude-haiku-4-5"
    - temperature: 0.3
    - max_tokens: 32000
    """

    model: typing.Optional[AgentConfigModel] = pydantic.Field(default=None)
    """
    LLM model name or ordered list of model names. First is primary, rest are fallbacks. Provider derived from name (e.g., "gpt-4o" → OpenAI, "claude-sonnet-4-5" → Anthropic, "gemini-2.5-flash" → Google). Default: "claude-haiku-4-5".
    """

    temperature: typing.Optional[float] = pydantic.Field(default=None)
    """
    LLM temperature. Default: 0.3.
    """

    max_tokens: typing.Optional[int] = pydantic.Field(default=None)
    """
    Maximum output tokens per LLM call. Default: 32000.
    """

    tools: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Tool names to enable for the agent. Platform always enables emit_atoms. Product can request integration tools (e.g., 'Salesforce__salesforce_query'). Default: [] (no additional tools).
    """

    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
