# 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 ScorerConfigRuntime(UncheckedBaseModel):
    """
    Runtime scorer configuration for a test case.

    References a scorer by ID and provides its config + execution settings.
    """

    scorer_id: str = pydantic.Field()
    """
    ID of scorer (from registry or built-in)
    """

    config: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field()
    """
    Scorer-specific configuration (typed config serialized as dict)
    """

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

    pass_threshold_override: typing.Optional[float] = pydantic.Field(default=None)
    """
    Override scorer's default pass threshold (0-1)
    """

    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
