# Generated by ariadne-codegen
# Source: vals/graphql/

from datetime import datetime
from typing import Any, List, Optional

from pydantic import Field

from .base_model import BaseModel
from .enums import TemplateType, TestResultReviewStatusEnum


class SingleTestResultReviewsWithCount(BaseModel):
    test_result_reviews_with_count: (
        "SingleTestResultReviewsWithCountTestResultReviewsWithCount"
    ) = Field(alias="testResultReviewsWithCount")


class SingleTestResultReviewsWithCountTestResultReviewsWithCount(BaseModel):
    count: int
    single_test_results: List[
        "SingleTestResultReviewsWithCountTestResultReviewsWithCountSingleTestResults"
    ] = Field(alias="singleTestResults")


class SingleTestResultReviewsWithCountTestResultReviewsWithCountSingleTestResults(
    BaseModel
):
    id: str
    reviewed_by: Optional[List[str]] = Field(alias="reviewedBy")
    has_feedback: Optional[bool] = Field(alias="hasFeedback")
    agreement_rate_auto_eval: Optional[float] = Field(alias="agreementRateAutoEval")
    agreement_rate_human_eval: Optional[float] = Field(alias="agreementRateHumanEval")
    pass_rate_human_eval: Optional[float] = Field(alias="passRateHumanEval")
    pass_percentage: float = Field(alias="passPercentage")
    amount_reviewed: int = Field(alias="amountReviewed")
    latest_completed_review: Optional[datetime] = Field(alias="latestCompletedReview")
    llm_output: str = Field(alias="llmOutput")
    typed_result_json: List[
        "SingleTestResultReviewsWithCountTestResultReviewsWithCountSingleTestResultsTypedResultJson"
    ] = Field(alias="typedResultJson")
    qa_pair: Optional[
        "SingleTestResultReviewsWithCountTestResultReviewsWithCountSingleTestResultsQaPair"
    ] = Field(alias="qaPair")
    test: "SingleTestResultReviewsWithCountTestResultReviewsWithCountSingleTestResultsTest"
    typed_metadata: (
        "SingleTestResultReviewsWithCountTestResultReviewsWithCountSingleTestResultsTypedMetadata"
    ) = Field(alias="typedMetadata")
    aggregated_custom_metrics: Optional[
        List[
            "SingleTestResultReviewsWithCountTestResultReviewsWithCountSingleTestResultsAggregatedCustomMetrics"
        ]
    ] = Field(alias="aggregatedCustomMetrics")
    single_test_reviews: Optional[
        List[
            "SingleTestResultReviewsWithCountTestResultReviewsWithCountSingleTestResultsSingleTestReviews"
        ]
    ] = Field(alias="singleTestReviews")


class SingleTestResultReviewsWithCountTestResultReviewsWithCountSingleTestResultsTypedResultJson(
    BaseModel
):
    auto_eval: float = Field(alias="autoEval")
    criteria: str
    operator: str


class SingleTestResultReviewsWithCountTestResultReviewsWithCountSingleTestResultsQaPair(
    BaseModel
):
    context: Any
    output_context: Any = Field(alias="outputContext")
    error_message: str = Field(alias="errorMessage")


class SingleTestResultReviewsWithCountTestResultReviewsWithCountSingleTestResultsTest(
    BaseModel
):
    test_id: str = Field(alias="testId")
    input_under_test: str = Field(alias="inputUnderTest")
    typed_context: Any = Field(alias="typedContext")


class SingleTestResultReviewsWithCountTestResultReviewsWithCountSingleTestResultsTypedMetadata(
    BaseModel
):
    in_tokens: int = Field(alias="inTokens")
    out_tokens: int = Field(alias="outTokens")
    duration_seconds: float = Field(alias="durationSeconds")


class SingleTestResultReviewsWithCountTestResultReviewsWithCountSingleTestResultsAggregatedCustomMetrics(
    BaseModel
):
    base: Optional[
        "SingleTestResultReviewsWithCountTestResultReviewsWithCountSingleTestResultsAggregatedCustomMetricsBase"
    ]
    comparative: bool
    name: str
    type: TemplateType
    result_a: Optional[
        "SingleTestResultReviewsWithCountTestResultReviewsWithCountSingleTestResultsAggregatedCustomMetricsResultA"
    ] = Field(alias="resultA")
    result_b: Optional[
        "SingleTestResultReviewsWithCountTestResultReviewsWithCountSingleTestResultsAggregatedCustomMetricsResultB"
    ] = Field(alias="resultB")


class SingleTestResultReviewsWithCountTestResultReviewsWithCountSingleTestResultsAggregatedCustomMetricsBase(
    BaseModel
):
    displayed: str
    value: Any


class SingleTestResultReviewsWithCountTestResultReviewsWithCountSingleTestResultsAggregatedCustomMetricsResultA(
    BaseModel
):
    displayed: str
    value: Any


class SingleTestResultReviewsWithCountTestResultReviewsWithCountSingleTestResultsAggregatedCustomMetricsResultB(
    BaseModel
):
    displayed: str
    value: Any


class SingleTestResultReviewsWithCountTestResultReviewsWithCountSingleTestResultsSingleTestReviews(
    BaseModel
):
    id: Any
    completed_by: str = Field(alias="completedBy")
    feedback: str
    completed_at: Optional[datetime] = Field(alias="completedAt")
    started_at: datetime = Field(alias="startedAt")
    created_by: str = Field(alias="createdBy")
    status: TestResultReviewStatusEnum
    per_check_test_review_typed: List[
        "SingleTestResultReviewsWithCountTestResultReviewsWithCountSingleTestResultsSingleTestReviewsPerCheckTestReviewTyped"
    ] = Field(alias="perCheckTestReviewTyped")
    test_result: (
        "SingleTestResultReviewsWithCountTestResultReviewsWithCountSingleTestResultsSingleTestReviewsTestResult"
    ) = Field(alias="testResult")
    custom_review_values: List[
        "SingleTestResultReviewsWithCountTestResultReviewsWithCountSingleTestResultsSingleTestReviewsCustomReviewValues"
    ] = Field(alias="customReviewValues")


class SingleTestResultReviewsWithCountTestResultReviewsWithCountSingleTestResultsSingleTestReviewsPerCheckTestReviewTyped(
    BaseModel
):
    binary_human_eval: Optional[int] = Field(alias="binaryHumanEval")
    is_flagged: Optional[bool] = Field(alias="isFlagged")


class SingleTestResultReviewsWithCountTestResultReviewsWithCountSingleTestResultsSingleTestReviewsTestResult(
    BaseModel
):
    id: str
    typed_result_json: List[
        "SingleTestResultReviewsWithCountTestResultReviewsWithCountSingleTestResultsSingleTestReviewsTestResultTypedResultJson"
    ] = Field(alias="typedResultJson")


class SingleTestResultReviewsWithCountTestResultReviewsWithCountSingleTestResultsSingleTestReviewsTestResultTypedResultJson(
    BaseModel
):
    auto_eval: float = Field(alias="autoEval")
    criteria: str
    operator: str


class SingleTestResultReviewsWithCountTestResultReviewsWithCountSingleTestResultsSingleTestReviewsCustomReviewValues(
    BaseModel
):
    template: "SingleTestResultReviewsWithCountTestResultReviewsWithCountSingleTestResultsSingleTestReviewsCustomReviewValuesTemplate"
    value: str


class SingleTestResultReviewsWithCountTestResultReviewsWithCountSingleTestResultsSingleTestReviewsCustomReviewValuesTemplate(
    BaseModel
):
    id: Any
    name: str
    instructions: str
    optional: bool
    categories: Optional[List[str]]
    type: TemplateType
    min_value: Optional[int] = Field(alias="minValue")
    max_value: Optional[int] = Field(alias="maxValue")


SingleTestResultReviewsWithCount.model_rebuild()
SingleTestResultReviewsWithCountTestResultReviewsWithCount.model_rebuild()
SingleTestResultReviewsWithCountTestResultReviewsWithCountSingleTestResults.model_rebuild()
SingleTestResultReviewsWithCountTestResultReviewsWithCountSingleTestResultsAggregatedCustomMetrics.model_rebuild()
SingleTestResultReviewsWithCountTestResultReviewsWithCountSingleTestResultsSingleTestReviews.model_rebuild()
SingleTestResultReviewsWithCountTestResultReviewsWithCountSingleTestResultsSingleTestReviewsTestResult.model_rebuild()
SingleTestResultReviewsWithCountTestResultReviewsWithCountSingleTestResultsSingleTestReviewsCustomReviewValues.model_rebuild()
