# 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 .simulation_test_model_dynamic_variables_value import SimulationTestModelDynamicVariablesValue
from .test_from_conversation_metadata_output import TestFromConversationMetadataOutput


class SimulationTestModel(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[SimulationTestModelDynamicVariablesValue]]] = (
        pydantic.Field(default=None)
    )
    """
    Dynamic variables to replace in the agent config during testing
    """

    chat_history: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelOutput]] = None
    success_condition: typing.Optional[str] = pydantic.Field(default=None)
    """
    A prompt that evaluates whether the agent's response is successful. Should return True or False.
    """

    simulation_scenario: typing.Optional[str] = pydantic.Field(default=None)
    """
    Description of the simulation scenario and user persona for simulation tests.
    """

    simulation_max_turns: typing.Optional[int] = pydantic.Field(default=None)
    """
    Maximum number of conversation turns for simulation tests.
    """

    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(SimulationTestModel)
