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

import datetime as dt
import typing

import pydantic
import typing_extensions
from ...core.pydantic_utilities import IS_PYDANTIC_V2
from ...core.serialization import FieldMetadata
from ...core.unchecked_base_model import UncheckedBaseModel
from .agent_dto_background_sound import AgentDtoBackgroundSound
from .agent_dto_language import AgentDtoLanguage
from .agent_dto_slm_model import AgentDtoSlmModel
from .agent_dto_synthesizer import AgentDtoSynthesizer
from .workflow_type import WorkflowType


class AgentDto(UncheckedBaseModel):
    id: typing_extensions.Annotated[
        typing.Optional[str], FieldMetadata(alias="_id"), pydantic.Field(alias="_id", description="The ID of the agent")
    ] = None
    name: typing.Optional[str] = pydantic.Field(default=None)
    """
    The name of the agent
    """

    description: typing.Optional[str] = pydantic.Field(default=None)
    """
    The description of the agent
    """

    background_sound: typing_extensions.Annotated[
        typing.Optional[AgentDtoBackgroundSound],
        FieldMetadata(alias="backgroundSound"),
        pydantic.Field(
            alias="backgroundSound",
            description="Ambient background sound during calls. Options: '' (none), 'office', 'cafe', 'call_center', 'static'.",
        ),
    ] = None
    organization: typing.Optional[str] = pydantic.Field(default=None)
    """
    The organization ID of the agent
    """

    workflow_id: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="workflowId"),
        pydantic.Field(alias="workflowId", description="The workflow ID of the agent"),
    ] = None
    workflow_type: typing_extensions.Annotated[
        typing.Optional[WorkflowType],
        FieldMetadata(alias="workflowType"),
        pydantic.Field(alias="workflowType", description="The type of workflow used by the agent"),
    ] = None
    created_by: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="createdBy"),
        pydantic.Field(alias="createdBy", description="The user ID of the user who created the agent"),
    ] = None
    global_knowledge_base_id: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="globalKnowledgeBaseId"),
        pydantic.Field(alias="globalKnowledgeBaseId", description="The global knowledge base ID of the agent"),
    ] = None
    language: typing.Optional[AgentDtoLanguage] = pydantic.Field(default=None)
    """
    The language configuration of the agent
    """

    synthesizer: typing.Optional[AgentDtoSynthesizer] = pydantic.Field(default=None)
    """
    The synthesizer (TTS) configuration of the agent
    """

    slm_model: typing_extensions.Annotated[
        typing.Optional[AgentDtoSlmModel],
        FieldMetadata(alias="slmModel"),
        pydantic.Field(
            alias="slmModel",
            description="The LLM model to use for the agent. LLM model will be used to generate the response and take decisions based on the user's query.",
        ),
    ] = None
    default_variables: typing_extensions.Annotated[
        typing.Optional[typing.Dict[str, typing.Any]],
        FieldMetadata(alias="defaultVariables"),
        pydantic.Field(
            alias="defaultVariables",
            description="The default variables to use for the agent. These variables will be used if no variables are provided when initiating a conversation with the agent.",
        ),
    ] = None
    created_at: typing_extensions.Annotated[
        typing.Optional[dt.datetime],
        FieldMetadata(alias="createdAt"),
        pydantic.Field(alias="createdAt", description="The date and time when the agent was created"),
    ] = None
    updated_at: typing_extensions.Annotated[
        typing.Optional[dt.datetime],
        FieldMetadata(alias="updatedAt"),
        pydantic.Field(alias="updatedAt", description="The date and time when the agent was last updated"),
    ] = None

    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
