# 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 .agent_call_limits import AgentCallLimits
from .agent_metadata_db_model import AgentMetadataDbModel
from .asr_conversational_config import AsrConversationalConfig
from .base_turn_config import BaseTurnConfig
from .conversation_config_output import ConversationConfigOutput
from .privacy_config_output import PrivacyConfigOutput
from .resource_access_info import ResourceAccessInfo
from .speech_engine_config import SpeechEngineConfig
from .speech_engine_conversation_initiation_client_data_config import SpeechEngineConversationInitiationClientDataConfig
from .tts_conversational_config_output import TtsConversationalConfigOutput
from .vad_config import VadConfig


class SpeechEngineResponse(UncheckedBaseModel):
    speech_engine_id: str = pydantic.Field()
    """
    The speech engine resource ID
    """

    name: str = pydantic.Field()
    """
    Human-readable name for the speech engine
    """

    speech_engine: SpeechEngineConfig = pydantic.Field()
    """
    WebSocket connection settings for the upstream transcript server
    """

    asr: AsrConversationalConfig = pydantic.Field()
    """
    Automatic speech recognition configuration
    """

    tts: TtsConversationalConfigOutput = pydantic.Field()
    """
    Text-to-speech output configuration
    """

    turn: BaseTurnConfig = pydantic.Field()
    """
    Turn detection configuration
    """

    vad: VadConfig = pydantic.Field()
    """
    Configuration for voice activity detection
    """

    conversation: ConversationConfigOutput = pydantic.Field()
    """
    Conversation-level settings including client events and duration limits
    """

    privacy: PrivacyConfigOutput = pydantic.Field()
    """
    Privacy settings controlling recording, retention, and PII handling
    """

    call_limits: AgentCallLimits = pydantic.Field()
    """
    Concurrency and daily conversation limits for this speech engine
    """

    language: str = pydantic.Field()
    """
    ISO language code used by the speech engine (e.g. 'en')
    """

    tags: typing.List[str] = pydantic.Field()
    """
    Arbitrary tags for categorization and filtering
    """

    overrides: SpeechEngineConversationInitiationClientDataConfig = pydantic.Field()
    """
    Override settings the client may set during conversation initiation
    """

    metadata: AgentMetadataDbModel = pydantic.Field()
    """
    Creation and update timestamps with source information
    """

    access_info: typing.Optional[ResourceAccessInfo] = pydantic.Field(default=None)
    """
    The access information of the speech engine for the user
    """

    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
