# This file was auto-generated by Fern from our API Definition.

from __future__ import annotations

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs
from ..core.unchecked_base_model import UncheckedBaseModel
from .agent_metadata import AgentMetadata
from .chat_source_medium import ChatSourceMedium
from .conversation_history_multivoice_message_model import ConversationHistoryMultivoiceMessageModel
from .conversation_history_transcript_common_model_output_role import ConversationHistoryTranscriptCommonModelOutputRole
from .conversation_history_transcript_common_model_output_tool_results_item import (
    ConversationHistoryTranscriptCommonModelOutputToolResultsItem,
)
from .conversation_history_transcript_tool_call_common_model_output import (
    ConversationHistoryTranscriptToolCallCommonModelOutput,
)
from .conversation_reasoning_model import ConversationReasoningModel
from .conversation_turn_metrics import ConversationTurnMetrics
from .llm_usage_output import LlmUsageOutput
from .rag_retrieval_info import RagRetrievalInfo
from .user_feedback import UserFeedback


class ConversationHistoryTranscriptCommonModelOutput(UncheckedBaseModel):
    role: ConversationHistoryTranscriptCommonModelOutputRole
    agent_metadata: typing.Optional[AgentMetadata] = None
    message: typing.Optional[str] = None
    multivoice_message: typing.Optional[ConversationHistoryMultivoiceMessageModel] = None
    tool_calls: typing.Optional[typing.List[ConversationHistoryTranscriptToolCallCommonModelOutput]] = None
    tool_results: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelOutputToolResultsItem]] = None
    feedback: typing.Optional[UserFeedback] = None
    llm_override: typing.Optional[str] = None
    time_in_call_secs: int
    conversation_turn_metrics: typing.Optional[ConversationTurnMetrics] = None
    rag_retrieval_info: typing.Optional[RagRetrievalInfo] = None
    llm_usage: typing.Optional[LlmUsageOutput] = None
    interrupted: typing.Optional[bool] = None
    ignored_as_backchannel: typing.Optional[bool] = None
    original_message: typing.Optional[str] = None
    reasoning: typing.Optional[typing.List[ConversationReasoningModel]] = None
    source_medium: typing.Optional[ChatSourceMedium] = None
    source_event_id: typing.Optional[int] = None
    used_static_kb_document_ids: typing.Optional[typing.List[str]] = None
    user_identifier: typing.Optional[str] = None
    id: typing.Optional[str] = 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


update_forward_refs(ConversationHistoryTranscriptCommonModelOutput)
