# 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 .conversation_history_transcript_common_model_output import ConversationHistoryTranscriptCommonModelOutput
from .conversation_initiation_source import ConversationInitiationSource
from .dynamic_variable_value_type_output import DynamicVariableValueTypeOutput
from .test_from_conversation_metadata_output import TestFromConversationMetadataOutput
from .unit_test_tool_call_evaluation_model_output import UnitTestToolCallEvaluationModelOutput


class GetToolCallUnitTestResponseModel(UncheckedBaseModel):
    from_conversation_metadata: typing.Optional[TestFromConversationMetadataOutput] = pydantic.Field(default=None)
    """
    Metadata of a conversation this test was created from (if applicable).
    """

    dynamic_variables: typing.Optional[typing.Dict[str, typing.Optional[DynamicVariableValueTypeOutput]]] = (
        pydantic.Field(default=None)
    )
    """
    Dynamic variables to replace in the agent config during testing
    """

    chat_history: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelOutput]] = None
    conversation_initiation_source: typing.Optional[ConversationInitiationSource] = pydantic.Field(default=None)
    """
    Simulate the test as if the conversation originated from this channel.
    """

    tool_call_parameters: typing.Optional[UnitTestToolCallEvaluationModelOutput] = pydantic.Field(default=None)
    """
    How to evaluate the agent's tool call (if any). If empty, the tool call is not evaluated.
    """

    check_any_tool_matches: typing.Optional[bool] = pydantic.Field(default=None)
    """
    If set to True this test will pass if any tool call returned by the LLM matches the criteria. Otherwise it will fail if more than one tool is returned by the agent.
    """

    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


update_forward_refs(GetToolCallUnitTestResponseModel)
