# 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 .retry_configuration import RetryConfiguration


class AgentModel(UniversalBaseModel):
    """
    Configuration for the model used in this step, including the model name and arbitrary parameters.
    """

    name: str = pydantic.Field()
    """
    The name of the model to use for this step.
    """

    parameters: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
    """
    Arbitrary model-specific parameters that can be passed to the model.
    """

    retry_configuration: typing.Optional[RetryConfiguration] = pydantic.Field(default=None)
    """
    Optional retry configuration for handling transient failures. When not provided, no retry is performed.
    """

    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
