Download common/exceptions.py from muryshev/generic-chatbot-backend: direct link, hf CLI and curl.
- Browser
- Download file 1.01 kB
-
https://huggingface.co/spaces/muryshev/generic-chatbot-backend/resolve/main/common/exceptions.py
- Command line
-
hf download hf://spaces/muryshev/generic-chatbot-backend/common/exceptions.py
-
curl -L -o exceptions.py https://huggingface.co/spaces/muryshev/generic-chatbot-backend/resolve/main/common/exceptions.py
1.01 kB
| 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} времени") | |