# 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 .scorer_config_runtime import ScorerConfigRuntime
from .test_case_assertions_item import TestCaseAssertionsItem


class TestCase(UncheckedBaseModel):
    """
    A single test case for workflow evaluation
    """

    name: str = pydantic.Field()
    """
    Test case name/description
    """

    input: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field()
    """
    Input data to pass to workflow (matches workflow input schema)
    """

    expected_output: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
    """
    Expected output from workflow
    """

    assertions: typing.Optional[typing.List[TestCaseAssertionsItem]] = pydantic.Field(default=None)
    """
    [LEGACY] Type-safe assertions to check (use scorers instead)
    """

    scorers: typing.Optional[typing.List[ScorerConfigRuntime]] = pydantic.Field(default=None)
    """
    Scorer configurations for this test case
    """

    metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
    """
    Additional metadata (e.g., row_id, tags)
    """

    tags: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Tags for grouping (e.g., feature names)
    """

    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
