# 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 ...types.agent_dto import AgentDto
from .get_conversation_id_response_data_type import GetConversationIdResponseDataType
from .get_conversation_id_response_data_voice_config_used import GetConversationIdResponseDataVoiceConfigUsed


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

    duration: typing.Optional[float] = pydantic.Field(default=None)
    """
    The duration of the conversation in seconds
    """

    recording_url: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="recordingUrl"),
        pydantic.Field(alias="recordingUrl", description="The recording URL of the conversation"),
    ] = None
    from_: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="from"),
        pydantic.Field(alias="from", description="The phone number of the caller"),
    ] = None
    to: typing.Optional[str] = pydantic.Field(default=None)
    """
    The phone number of the callee
    """

    transcript: typing.Optional[typing.List[typing.Any]] = pydantic.Field(default=None)
    """
    The transcript of the conversation
    """

    average_transcriber_latency: typing.Optional[float] = pydantic.Field(default=None)
    """
    The average time taken by the TTS to transcribe the conversation
    """

    average_agent_latency: typing.Optional[float] = pydantic.Field(default=None)
    """
    The average time taken by the LLM to respond to the conversation
    """

    average_synthesizer_latency: typing.Optional[float] = pydantic.Field(default=None)
    """
    The average time taken by the TTS to synthesize the conversation
    """

    type: typing.Optional[GetConversationIdResponseDataType] = pydantic.Field(default=None)
    """
    The type of the conversation
    """

    voice_config_used: typing_extensions.Annotated[
        typing.Optional[GetConversationIdResponseDataVoiceConfigUsed],
        FieldMetadata(alias="voiceConfigUsed"),
        pydantic.Field(
            alias="voiceConfigUsed", description="The voice configuration that was actually used for this call."
        ),
    ] = None
    slm_model_used: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="slmModelUsed"),
        pydantic.Field(alias="slmModelUsed", description="The SLM/LLM model that was actually used for this call."),
    ] = 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
