# 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 .start_agents_request_properties_sal_sal_mode import StartAgentsRequestPropertiesSalSalMode


class StartAgentsRequestPropertiesSal(UncheckedBaseModel):
    """
    Selective Attention Locking (SAL) configuration.
    """

    sal_mode: typing.Optional[StartAgentsRequestPropertiesSalSalMode] = pydantic.Field(default=None)
    """
    Selective attention lock mode:
    - `locking`: Speaker Lock Mode. The agent locks onto the speaker, blocking 95% of ambient human voices and noise. You can enable this mode in two ways:
      - Seamless mode: When a user speaks loudly and clearly at the beginning of a conversation, the intelligent agent automatically recognizes the user as the speaker.
      - Personalized mode: When creating an agent, a speaker's voiceprint URL is pre-registered through the `sample_urls` field. The agent then locates the speaker based on the pre-registered voiceprint.
    - `recognition`: Voiceprint recognition mode. The agent identifies different speakers and suppresses other background voices and environmental noise.
    """

    sample_urls: typing.Optional[typing.Dict[str, str]] = pydantic.Field(default=None)
    """
    The registered voiceprint URL as a key-value pair, where the key is the voiceprint name and the value is the download URL for the speaker's voiceprint. Only one voiceprint URL is supported.
    > - Do not set the incoming voiceprint name to "unknown"; this is a reserved keyword used to identify unknown speakers.
    > - For a registered voiceprint, ensure that:
    >   - Size: A single voiceprint file must not exceed 2 MB.
    >   - Duration: 10 to 15 seconds, with at least 8 seconds of effective audio without silent segments.
    >   - Format: 16kHz sampling rate, 16-bit depth, mono PCM audio file. The file name extension must be ".pcm".
    """

    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
