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

from typing import Any, List, Optional

from pydantic import Field

from .base_model import BaseModel


class ExampleOutputTypeFields(BaseModel):
    type: str
    text: str


class ConditionalCheckOutputTypeFields(BaseModel):
    operator: str
    criteria: str


class CheckModifierOutputTypeFields(BaseModel):
    optional: bool
    severity: Optional[float]
    display_metrics: bool = Field(alias="displayMetrics")
    examples: List["CheckModifierOutputTypeFieldsExamples"]
    extractor: Optional[str]
    conditional: Optional["CheckModifierOutputTypeFieldsConditional"]
    category: Optional[str]


class CheckModifierOutputTypeFieldsExamples(ExampleOutputTypeFields):
    pass


class CheckModifierOutputTypeFieldsConditional(ConditionalCheckOutputTypeFields):
    pass


class CheckOutputTypeFields(BaseModel):
    operator: str
    criteria: str
    modifiers: "CheckOutputTypeFieldsModifiers"


class CheckOutputTypeFieldsModifiers(CheckModifierOutputTypeFields):
    pass


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


class ResultJsonElementTypeFields(BaseModel):
    operator: str
    criteria: str
    modifiers: "ResultJsonElementTypeFieldsModifiers"
    auto_eval: float = Field(alias="autoEval")
    feedback: str
    eval_cont: float = Field(alias="evalCont")
    is_global: bool = Field(alias="isGlobal")
    severity: float
    custom_operator: Optional["ResultJsonElementTypeFieldsCustomOperator"] = Field(
        alias="customOperator"
    )


class ResultJsonElementTypeFieldsModifiers(CheckModifierOutputTypeFields):
    pass


class ResultJsonElementTypeFieldsCustomOperator(BaseModel):
    rubric: Optional[List["ResultJsonElementTypeFieldsCustomOperatorRubric"]]


class ResultJsonElementTypeFieldsCustomOperatorRubric(BaseModel):
    label: str
    score: int


class TestFragment(BaseModel):
    id: str
    input_under_test: str = Field(alias="inputUnderTest")
    context: Any
    tags: List[str]
    cross_version_id: str = Field(alias="crossVersionId")
    golden_output: str = Field(alias="goldenOutput")
    file_ids: List[str] = Field(alias="fileIds")
    checks: List["TestFragmentChecks"]
    test_suite: "TestFragmentTestSuite" = Field(alias="testSuite")


class TestFragmentChecks(BaseModel):
    operator: str
    criteria: str
    modifiers: "TestFragmentChecksModifiers"


class TestFragmentChecksModifiers(BaseModel):
    optional: bool
    severity: Optional[float]
    examples: List["TestFragmentChecksModifiersExamples"]
    extractor: Optional[str]
    conditional: Optional["TestFragmentChecksModifiersConditional"]
    category: Optional[str]
    display_metrics: bool = Field(alias="displayMetrics")


class TestFragmentChecksModifiersExamples(BaseModel):
    type: str
    text: str


class TestFragmentChecksModifiersConditional(BaseModel):
    operator: str
    criteria: str


class TestFragmentTestSuite(BaseModel):
    id: str


class TestResultFields(BaseModel):
    id: Any
    llm_output: str = Field(alias="llmOutput")
    pass_percentage: float = Field(alias="passPercentage")
    pass_percentage_with_weight: float = Field(alias="passPercentageWithWeight")
    result_json: List["TestResultFieldsResultJson"] = Field(alias="resultJson")
    qa_pair: Optional["TestResultFieldsQaPair"] = Field(alias="qaPair")
    test: "TestResultFieldsTest"
    metadata: "TestResultFieldsMetadata"


class TestResultFieldsResultJson(ResultJsonElementTypeFields):
    pass


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


class TestResultFieldsTest(TestFragment):
    pass


class TestResultFieldsMetadata(MetadataOutputTypeFields):
    pass


ExampleOutputTypeFields.model_rebuild()
ConditionalCheckOutputTypeFields.model_rebuild()
CheckModifierOutputTypeFields.model_rebuild()
CheckOutputTypeFields.model_rebuild()
MetadataOutputTypeFields.model_rebuild()
ResultJsonElementTypeFields.model_rebuild()
TestFragment.model_rebuild()
TestResultFields.model_rebuild()
