Spaces:
Sleeping
Sleeping
File size: 660 Bytes
577870e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
from pydantic import BaseModel, Field, conint
from typing import List, Optional, Literal, Union
class Criteria(BaseModel):
name: str
description: str
min_score: conint(ge=0)
max_score: conint(ge=0)
class DirectAssessment(BaseModel):
type: Literal["direct_assessment"]
criteria: List[Criteria]
prompt: str
class PairwiseComparison(BaseModel):
type: Literal["pairwise_comparison"]
granularity: Literal["coarse", "fine", "super fine"]
ties_allowed: bool
position_swapping: bool
reference_model: str
prompt: str
class JudgingConfig(BaseModel):
assessment: Union[DirectAssessment, PairwiseComparison]
|