# 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


class EvaluationRunQuery(UncheckedBaseModel):
    """
    Query parameters for filtering evaluation runs.
    """

    evaluation_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Filter by parent evaluation ID
    """

    workflow_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    [DEPRECATED] Filter by workflow ID
    """

    status: typing.Optional[str] = pydantic.Field(default=None)
    """
    Filter by status
    """

    tags: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Filter by tags (AND)
    """

    created_after: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Filter runs created after this time
    """

    created_before: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Filter runs created before this time
    """

    min_pass_rate: typing.Optional[float] = pydantic.Field(default=None)
    """
    Minimum pass rate (0-1)
    """

    limit: typing.Optional[int] = pydantic.Field(default=None)
    """
    Maximum results to return
    """

    offset: typing.Optional[int] = pydantic.Field(default=None)
    """
    Number of results to skip
    """

    sort_by: typing.Optional[str] = pydantic.Field(default=None)
    """
    Field to sort by
    """

    sort_order: typing.Optional[str] = pydantic.Field(default=None)
    """
    Sort order: asc or desc
    """

    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
