File size: 1,744 Bytes
5d12635 069f0a0 5d12635 069f0a0 5d12635 069f0a0 5d12635 069f0a0 5d12635 069f0a0 7baf8ba 89f1173 3a2b22f |
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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
"""Custom exceptions for DeepBoner."""
class DeepBonerError(Exception):
"""Base exception for all DeepBoner errors."""
pass
class SearchError(DeepBonerError):
"""Raised when a search operation fails."""
pass
class JudgeError(DeepBonerError):
"""Raised when the judge fails to assess evidence."""
pass
class ConfigurationError(DeepBonerError):
"""Raised when configuration is invalid."""
pass
class RateLimitError(SearchError):
"""Raised when we hit API rate limits."""
pass
class EmbeddingError(DeepBonerError):
"""Raised when embedding or vector store operations fail."""
pass
class LLMError(DeepBonerError):
"""Raised when LLM operations fail (API errors, parsing errors, etc.)."""
pass
class QuotaExceededError(LLMError):
"""Raised when LLM API quota is exceeded (402 errors)."""
pass
class SynthesisError(DeepBonerError):
"""Raised when report synthesis fails after trying all available models.
Attributes:
message: Human-readable error description
attempted_models: List of model IDs that were tried
errors: List of error messages from each failed attempt
"""
def __init__(
self,
message: str,
attempted_models: list[str] | None = None,
errors: list[str] | None = None,
) -> None:
"""Initialize SynthesisError with context.
Args:
message: Human-readable error description
attempted_models: Models that were tried before failing
errors: Error messages from each failed model attempt
"""
super().__init__(message)
self.attempted_models = attempted_models or []
self.errors = errors or []
|