# 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


class PullRun(BaseModel):
    run: "PullRunRun"
    test_results: List["PullRunTestResults"] = Field(alias="testResults")


class PullRunRun(BaseModel):
    run_id: str = Field(alias="runId")
    pass_percentage: Optional[float] = Field(alias="passPercentage")
    status: str
    text_summary: str = Field(alias="textSummary")
    timestamp: datetime
    completed_at: Optional[datetime] = Field(alias="completedAt")
    archived: bool
    typed_parameters: "PullRunRunTypedParameters" = Field(alias="typedParameters")
    pass_rate: Optional["PullRunRunPassRate"] = Field(alias="passRate")
    success_rate: Optional["PullRunRunSuccessRate"] = Field(alias="successRate")
    test_suite: "PullRunRunTestSuite" = Field(alias="testSuite")


class PullRunRunTypedParameters(BaseModel):
    eval_model: str = Field(alias="evalModel")
    maximum_threads: int = Field(alias="maximumThreads")
    run_golden_eval: bool = Field(alias="runGoldenEval")
    run_confidence_evaluation: bool = Field(alias="runConfidenceEvaluation")
    heavyweight_factor: int = Field(alias="heavyweightFactor")
    create_text_summary: bool = Field(alias="createTextSummary")
    model_under_test: str = Field(alias="modelUnderTest")
    temperature: float
    max_output_tokens: int = Field(alias="maxOutputTokens")
    system_prompt: str = Field(alias="systemPrompt")
    new_line_stop_option: bool = Field(alias="newLineStopOption")


class PullRunRunPassRate(BaseModel):
    value: float
    error: float


class PullRunRunSuccessRate(BaseModel):
    value: float
    error: float


class PullRunRunTestSuite(BaseModel):
    id: str
    title: str


class PullRunTestResults(BaseModel):
    id: str
    llm_output: str = Field(alias="llmOutput")
    pass_percentage: float = Field(alias="passPercentage")
    pass_percentage_with_optional: float = Field(alias="passPercentageWithOptional")
    result_json: Any = Field(alias="resultJson")
    qa_pair: Optional["PullRunTestResultsQaPair"] = Field(alias="qaPair")
    test: "PullRunTestResultsTest"
    metadata: Optional[Any]


class PullRunTestResultsQaPair(BaseModel):
    context: Any
    output_context: Any = Field(alias="outputContext")


class PullRunTestResultsTest(BaseModel):
    test_id: str = Field(alias="testId")
    input_under_test: str = Field(alias="inputUnderTest")
    context: Any


PullRun.model_rebuild()
PullRunRun.model_rebuild()
PullRunTestResults.model_rebuild()
