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

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 .create_agent_request_background_sound import CreateAgentRequestBackgroundSound
from .create_agent_request_language import CreateAgentRequestLanguage
from .create_agent_request_slm_model import CreateAgentRequestSlmModel
from .create_agent_request_synthesizer import CreateAgentRequestSynthesizer
from .workflow_type import WorkflowType


class CreateAgentRequest(UncheckedBaseModel):
    name: str
    description: typing.Optional[str] = None
    background_sound: typing_extensions.Annotated[
        typing.Optional[CreateAgentRequestBackgroundSound],
        FieldMetadata(alias="backgroundSound"),
        pydantic.Field(
            alias="backgroundSound",
            description="Ambient background sound during calls. Options: '' (none), 'office', 'cafe', 'call_center', 'static'.",
        ),
    ] = None
    language: typing.Optional[CreateAgentRequestLanguage] = pydantic.Field(default=None)
    """
    Language configuration for the agent. You can enable or disable language switching for the agent. This will be used to determine the language of the agent.
    """

    synthesizer: typing.Optional[CreateAgentRequestSynthesizer] = pydantic.Field(default=None)
    """
    Synthesizer configuration for the agent. You can configure the synthesizer to use different voices and models. Currently we support 3 types of models for the synthesizer. Waves, Waves Lightning Large and Waves Lightning Large Voice Clone. You can clone your voice using waves platform https://waves.smallest.ai/voice-clone and use the voiceId for this field and select the model as waves_lightning_large_voice_clone to use your cloned voice. When updating the synthesizer configuration to voice clone model, you have to provide model and voiceId and gender all are required fields but when selecting the model as waves or waves and waves_lightning_large, you have to provide only model field and voiceId.
    """

    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. You can create a global knowledge base by using the /knowledgebase endpoint and assign it to the agent. The agent will use this knowledge base for its responses.",
        ),
    ] = None
    slm_model: typing_extensions.Annotated[
        typing.Optional[CreateAgentRequestSlmModel],
        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
    global_prompt: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="globalPrompt"),
        pydantic.Field(
            alias="globalPrompt",
            description="Set global instructions for your agent's personality, role, and behavior throughout conversations. \nNote: Only used for workflow_graph agents.",
        ),
    ] = None
    telephony_product_id: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="telephonyProductId"),
        pydantic.Field(
            alias="telephonyProductId",
            description="The telephony product ID of the agent. This is the product ID of the telephony product that will be used to make the outbound call. You can buy telephone number and assign it to the agent.",
        ),
    ] = None
    workflow_type: typing_extensions.Annotated[
        typing.Optional[WorkflowType],
        FieldMetadata(alias="workflowType"),
        pydantic.Field(
            alias="workflowType",
            description="The type of workflow to create for the agent. Defaults to workflow_graph if not specified.",
        ),
    ] = 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
