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

import datetime as dt
import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .evaluation_config_output import EvaluationConfigOutput


class Evaluation(UncheckedBaseModel):
    """
    Saved evaluation configuration entity.

    Represents a reusable test suite that can be run multiple times.
    Stored in PostgreSQL evaluation_configs table.

    This is the template/definition that produces EvaluationRuns when executed.
    """

    id: str = pydantic.Field()
    """
    Unique evaluation ID
    """

    name: str = pydantic.Field()
    """
    Human-readable name for this evaluation
    """

    description: typing.Optional[str] = pydantic.Field(default=None)
    """
    Description of what this evaluates
    """

    config: EvaluationConfigOutput = pydantic.Field()
    """
    Evaluation configuration
    """

    created_at: dt.datetime = pydantic.Field()
    """
    When evaluation was created
    """

    updated_at: dt.datetime = pydantic.Field()
    """
    When evaluation was last updated
    """

    organization_id: str = pydantic.Field()
    """
    Organization that owns this evaluation
    """

    created_by: typing.Optional[str] = pydantic.Field(default=None)
    """
    User who created evaluation
    """

    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
