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

from __future__ import annotations

import typing

import pydantic
import typing_extensions
from ....core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs
from ....core.unchecked_base_model import UncheckedBaseModel, UnionMetadata
from ....types.agent_failure_response_example import AgentFailureResponseExample
from ....types.agent_successful_response_example import AgentSuccessfulResponseExample
from ....types.conversation_history_transcript_common_model_output import ConversationHistoryTranscriptCommonModelOutput
from ....types.get_response_unit_test_response_model_dynamic_variables_value import (
    GetResponseUnitTestResponseModelDynamicVariablesValue,
)
from ....types.get_simulation_test_response_model_dynamic_variables_value import (
    GetSimulationTestResponseModelDynamicVariablesValue,
)
from ....types.get_tool_call_unit_test_response_model_dynamic_variables_value import (
    GetToolCallUnitTestResponseModelDynamicVariablesValue,
)
from ....types.test_from_conversation_metadata_output import TestFromConversationMetadataOutput
from ....types.unit_test_tool_call_evaluation_model_output import UnitTestToolCallEvaluationModelOutput


class TestsUpdateResponse_Llm(UncheckedBaseModel):
    type: typing.Literal["llm"] = "llm"
    from_conversation_metadata: typing.Optional[TestFromConversationMetadataOutput] = None
    dynamic_variables: typing.Optional[
        typing.Dict[str, typing.Optional[GetResponseUnitTestResponseModelDynamicVariablesValue]]
    ] = None
    chat_history: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelOutput]] = None
    success_condition: typing.Optional[str] = None
    success_examples: typing.Optional[typing.List[AgentSuccessfulResponseExample]] = None
    failure_examples: typing.Optional[typing.List[AgentFailureResponseExample]] = None
    id: str
    name: str

    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


class TestsUpdateResponse_Tool(UncheckedBaseModel):
    type: typing.Literal["tool"] = "tool"
    from_conversation_metadata: typing.Optional[TestFromConversationMetadataOutput] = None
    dynamic_variables: typing.Optional[
        typing.Dict[str, typing.Optional[GetToolCallUnitTestResponseModelDynamicVariablesValue]]
    ] = None
    chat_history: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelOutput]] = None
    tool_call_parameters: typing.Optional[UnitTestToolCallEvaluationModelOutput] = None
    check_any_tool_matches: typing.Optional[bool] = None
    id: str
    name: str

    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


class TestsUpdateResponse_Simulation(UncheckedBaseModel):
    type: typing.Literal["simulation"] = "simulation"
    from_conversation_metadata: typing.Optional[TestFromConversationMetadataOutput] = None
    dynamic_variables: typing.Optional[
        typing.Dict[str, typing.Optional[GetSimulationTestResponseModelDynamicVariablesValue]]
    ] = None
    chat_history: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelOutput]] = None
    success_condition: typing.Optional[str] = None
    simulation_scenario: typing.Optional[str] = None
    simulation_max_turns: typing.Optional[int] = None
    id: str
    name: str

    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


TestsUpdateResponse = typing_extensions.Annotated[
    typing.Union[TestsUpdateResponse_Llm, TestsUpdateResponse_Tool, TestsUpdateResponse_Simulation],
    UnionMetadata(discriminant="type"),
]
update_forward_refs(TestsUpdateResponse_Llm)
update_forward_refs(TestsUpdateResponse_Tool)
update_forward_refs(TestsUpdateResponse_Simulation)
