# 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_history_transcript_system_tool_result_common_model_input_result import (
    ConversationHistoryTranscriptSystemToolResultCommonModelInputResult,
)
from .dynamic_variable_update_common_model import DynamicVariableUpdateCommonModel


class ConversationHistoryTranscriptSystemToolResultCommonModelInput(UncheckedBaseModel):
    request_id: str
    tool_name: str
    result_value: str
    is_error: bool
    is_blocked: typing.Optional[bool] = None
    tool_has_been_called: bool
    tool_latency_secs: typing.Optional[float] = None
    error_type: typing.Optional[str] = None
    raw_error_message: typing.Optional[str] = None
    dynamic_variable_updates: typing.Optional[typing.List[DynamicVariableUpdateCommonModel]] = None
    type: typing.Literal["system"] = "system"
    result: typing.Optional[ConversationHistoryTranscriptSystemToolResultCommonModelInputResult] = 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
