Files

20 lines
456 B
Python
Raw Permalink Normal View History

2026-06-08 13:53:12 +09:00
from typing import override
2024-08-26 19:36:44 +08:00
class InvokeError(Exception):
"""Base class for all LLM exceptions."""
description: str = ""
2024-08-26 19:36:44 +08:00
def __init__(self, description: str = ""):
2024-08-26 19:36:44 +08:00
self.description = description
2026-06-08 13:53:12 +09:00
@override
2024-08-26 19:36:44 +08:00
def __str__(self):
return self.description or self.__class__.__name__
class InvokeRateLimitError(InvokeError):
"""Raised when the Invoke returns rate limit error."""
description = "Rate Limit Error"