"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT."""

from __future__ import annotations
import dataclasses
from .criteriafeedback import CriteriaFeedback
from .evaluationcriteriastatus import EvaluationCriteriaStatus
from .passfailunsurerubricscalevalues import PassFailUnsureRubricScaleValues
from dataclasses_json import Undefined, dataclass_json
from enum import Enum
from gantry import utils
from typing import List, Optional

class RagCriteriaStepType(str, Enum):
    r"""An enumeration."""
    QUERY = 'query'
    CHAT_HISTORY = 'chat_history'
    FUNCTION = 'function'
    DOCUMENTS = 'documents'
    OUTPUT = 'output'


@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class RagCriteriaResult:
    r"""Stores an evaluation criteria generation's parsed score and
    reasoning for a particular RAG step.
    """
    criteria_eval_instruction: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('criteria_eval_instruction') }})
    criteria_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('criteria_id') }})
    criteria_name: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('criteria_name') }})
    error_message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('error_message'), 'exclude': lambda f: f is None }})
    error_type: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('error_type'), 'exclude': lambda f: f is None }})
    feedback: Optional[List[CriteriaFeedback]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('feedback'), 'exclude': lambda f: f is None }})
    id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is None }})
    include_input_step: Optional[bool] = dataclasses.field(default=False, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('include_input_step'), 'exclude': lambda f: f is None }})
    include_output_step: Optional[bool] = dataclasses.field(default=False, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('include_output_step'), 'exclude': lambda f: f is None }})
    reasoning: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('reasoning'), 'exclude': lambda f: f is None }})
    relevant_step: Optional[RagCriteriaStepType] = dataclasses.field(default=RagCriteriaStepType.OUTPUT, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('relevant_step'), 'exclude': lambda f: f is None }})
    score: Optional[PassFailUnsureRubricScaleValues] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('score'), 'exclude': lambda f: f is None }})
    r"""An enumeration."""
    status: Optional[EvaluationCriteriaStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status'), 'exclude': lambda f: f is None }})
    r"""An enumeration."""
    steps: Optional[List[int]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('steps'), 'exclude': lambda f: f is None }})
    

