Spaces:
Sleeping
Sleeping
from pydantic import BaseModel, field_validator | |
from exceptions import InvalidEstimateException, InvalidUserScoreException | |
class FeedbackCreate(BaseModel): | |
log_id: int | |
userComment: str | |
userScore: int | |
manualEstimate: int | |
llmEstimate: int | |
def check_user_score(cls, value): | |
if not (1 <= value <= 5): | |
raise InvalidUserScoreException(value) | |
return value | |
def check_manual_estimate(cls, value): | |
if value < 1: | |
raise InvalidEstimateException(value) | |
return value | |
def check_llm_estimate(cls, value): | |
if value < 1: | |
raise InvalidEstimateException(value) | |
return value | |