# 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 .conversation_initiation_source import ConversationInitiationSource
from .conversation_sentiment_analysis import ConversationSentimentAnalysis
from .conversation_summary_response_model_status import ConversationSummaryResponseModelStatus
from .evaluation_criteria_summary_result import EvaluationCriteriaSummaryResult
from .evaluation_success_result import EvaluationSuccessResult
from .telephony_direction import TelephonyDirection


class ConversationSummaryResponseModel(UncheckedBaseModel):
    agent_id: str
    branch_id: typing.Optional[str] = None
    version_id: typing.Optional[str] = None
    agent_name: typing.Optional[str] = None
    conversation_id: str
    start_time_unix_secs: int
    call_duration_secs: int
    message_count: int
    status: ConversationSummaryResponseModelStatus
    termination_reason: typing.Optional[str] = None
    call_successful: EvaluationSuccessResult
    call_success_score: typing.Optional[float] = None
    transcript_summary: typing.Optional[str] = None
    call_summary_title: typing.Optional[str] = None
    main_language: typing.Optional[str] = None
    conversation_initiation_source: typing.Optional[ConversationInitiationSource] = None
    tool_names: typing.Optional[typing.List[str]] = None
    direction: typing.Optional[TelephonyDirection] = None
    rating: typing.Optional[float] = None
    sentiment_analysis: typing.Optional[ConversationSentimentAnalysis] = None
    data_collection_results: typing.Optional[typing.Dict[str, typing.Any]] = None
    evaluation_criteria_results: typing.Optional[typing.Dict[str, typing.Optional[EvaluationCriteriaSummaryResult]]] = (
        None
    )
    tag_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Conversation tag ids assigned to this conversation.
    """

    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
