# 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 .dynamic_variable_update_common_model import DynamicVariableUpdateCommonModel


class ConversationHistoryTranscriptWorkflowToolsResultCommonModelOutput(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["workflow"] = "workflow"
    result: typing.Optional["WorkflowToolResponseModelOutput"] = 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


from .workflow_tool_nested_tools_step_model_output import WorkflowToolNestedToolsStepModelOutput  # noqa: E402, I001
from .workflow_tool_nested_tools_step_model_output_results_item import WorkflowToolNestedToolsStepModelOutputResultsItem  # noqa: E402, I001
from .workflow_tool_response_model_output import WorkflowToolResponseModelOutput  # noqa: E402, I001
from .workflow_tool_response_model_output_steps_item import WorkflowToolResponseModelOutputStepsItem  # noqa: E402, I001

update_forward_refs(
    ConversationHistoryTranscriptWorkflowToolsResultCommonModelOutput,
    WorkflowToolNestedToolsStepModelOutput=WorkflowToolNestedToolsStepModelOutput,
    WorkflowToolNestedToolsStepModelOutputResultsItem=WorkflowToolNestedToolsStepModelOutputResultsItem,
    WorkflowToolResponseModelOutput=WorkflowToolResponseModelOutput,
    WorkflowToolResponseModelOutputStepsItem=WorkflowToolResponseModelOutputStepsItem,
)
