# 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 ...types.tts import Tts
from .start_agents_request_properties_advanced_features import StartAgentsRequestPropertiesAdvancedFeatures
from .start_agents_request_properties_asr import StartAgentsRequestPropertiesAsr
from .start_agents_request_properties_avatar import StartAgentsRequestPropertiesAvatar
from .start_agents_request_properties_filler_words import StartAgentsRequestPropertiesFillerWords
from .start_agents_request_properties_geofence import StartAgentsRequestPropertiesGeofence
from .start_agents_request_properties_llm import StartAgentsRequestPropertiesLlm
from .start_agents_request_properties_mllm import StartAgentsRequestPropertiesMllm
from .start_agents_request_properties_parameters import StartAgentsRequestPropertiesParameters
from .start_agents_request_properties_rtc import StartAgentsRequestPropertiesRtc
from .start_agents_request_properties_sal import StartAgentsRequestPropertiesSal
from .start_agents_request_properties_turn_detection import StartAgentsRequestPropertiesTurnDetection


class StartAgentsRequestProperties(UncheckedBaseModel):
    """
    Configuration details of the agent.
    """

    channel: str = pydantic.Field()
    """
    The name of the channel to join.
    """

    token: str = pydantic.Field()
    """
    The authentication token used by the agent to join the channel.
    """

    agent_rtc_uid: str = pydantic.Field()
    """
    The user ID of the agent in the channel. A value of `0` means that a random UID is generated and assigned. Set the `token` accordingly.
    """

    remote_rtc_uids: typing.List[str] = pydantic.Field()
    """
    A list of user IDs that the agent subscribes to in the channel. Only subscribed users can interact with the agent. Currently, only one user ID is supported.
    """

    enable_string_uid: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether to enable String uid:
    - `true`: Both agent and subscriber user IDs use strings.
    - `false`: Both agent and subscriber user IDs must be integers.
    """

    idle_timeout: typing.Optional[int] = pydantic.Field(default=None)
    """
    Sets the timeout after all the users specified in `remote_rtc_uids` are detected to have left the channel. When the timeout value is exceeded, the agent automatically stops and exits the channel. A value of `0` means that the agent does not exit until it is stopped manually.
    """

    geofence: typing.Optional[StartAgentsRequestPropertiesGeofence] = pydantic.Field(default=None)
    """
    Regional access restriction configuration. Use this to limit which Agora servers the Conversational AI Engine can access based on geographic regions.
    """

    advanced_features: typing.Optional[StartAgentsRequestPropertiesAdvancedFeatures] = pydantic.Field(default=None)
    """
    Advanced features configuration.
    """

    asr: typing.Optional[StartAgentsRequestPropertiesAsr] = pydantic.Field(default=None)
    """
    Automatic Speech Recognition (ASR) configuration.
    """

    tts: typing.Optional[Tts] = pydantic.Field(default=None)
    """
    Text-to-speech (TTS) module configuration.
    """

    llm: typing.Optional[StartAgentsRequestPropertiesLlm] = pydantic.Field(default=None)
    """
    Large language model (LLM) configuration.
    """

    mllm: typing.Optional[StartAgentsRequestPropertiesMllm] = pydantic.Field(default=None)
    """
    Multimodal Large Language Model (MLLM) configuration for real-time audio and text processing. MLLM is an exclusive alternative to the standard `asr` + `llm` + `tts` pipeline.
    """

    avatar: typing.Optional[StartAgentsRequestPropertiesAvatar] = pydantic.Field(default=None)
    """
    Avatar configuration.
    """

    turn_detection: typing.Optional[StartAgentsRequestPropertiesTurnDetection] = pydantic.Field(default=None)
    """
    Conversation turn detection settings. Controls the logic for voice activity detection and conversation turn determination.
    """

    sal: typing.Optional[StartAgentsRequestPropertiesSal] = pydantic.Field(default=None)
    """
    Selective Attention Locking (SAL) configuration.
    """

    labels: typing.Optional[typing.Dict[str, str]] = pydantic.Field(default=None)
    """
    Custom labels in key-value pair format, where the key is the label name and the value is the label value. Enables agents to carry custom business information. These labels are bound to the agent and returned in the `payload` field of all message notification callbacks from the conversational AI engine.
    """

    rtc: typing.Optional[StartAgentsRequestPropertiesRtc] = pydantic.Field(default=None)
    """
    RTC media encryption configuration.
    """

    filler_words: typing.Optional[StartAgentsRequestPropertiesFillerWords] = pydantic.Field(default=None)
    """
    Filler word configuration. Plays filler words while waiting for LLM responses to reduce user anxiety and improve conversation flow.
    """

    parameters: typing.Optional[StartAgentsRequestPropertiesParameters] = pydantic.Field(default=None)
    """
    Agent configuration parameters.
    """

    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
