File size: 1,007 Bytes
57cf043
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from fastapi import HTTPException


class FeedbackNotFoundException(HTTPException):
    def __init__(self, feedback_id: int):
        super().__init__(status_code=404, detail=f"Отзыв id={feedback_id} не найден")

class LLMResponseException(HTTPException):
    def __init__(self, detail: str = "Не удалось получить ответ LLM"):
        super().__init__(status_code=400, detail=detail)

class LogNotFoundException(HTTPException):
    def __init__(self, log_id: int):
        super().__init__(status_code=404, detail=f"Лог id={log_id} не найден")

class InvalidUserScoreException(HTTPException):
    def __init__(self, userScore: int):
        super().__init__(status_code=400, detail=f"Невалидная оценка {userScore} ответа LLM")

class InvalidEstimateException(HTTPException):
    def __init__(self, estimate_value: int):
        super().__init__(status_code=400, detail=f"Невалидная оценка {estimate_value} времени")