# 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


class ScoreField(UncheckedBaseModel):
    """
    Configuration for a single scoring dimension/criterion.

    Defines what to measure, the scoring range, and how much it contributes
    to the composite score. Used by AgentScorer to define evaluation dimensions.

    Example:
        field = ScoreField(
            name="accuracy",
            description="Factual correctness of the response",
            min=0.0,
            max=100.0,
            weight=2.0  # Counts twice as much as other dimensions
        )
    """

    name: str = pydantic.Field()
    """
    Dimension name (e.g., 'accuracy', 'helpfulness')
    """

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

    min: typing.Optional[float] = pydantic.Field(default=None)
    """
    Minimum score value (supports arbitrary ranges)
    """

    max: typing.Optional[float] = pydantic.Field(default=None)
    """
    Maximum score value (supports arbitrary ranges)
    """

    weight: typing.Optional[float] = pydantic.Field(default=None)
    """
    Weight for composite scoring (higher = more important)
    """

    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
