2024-08-26 19:36:44 +08:00
|
|
|
class InvokeError(Exception):
|
|
|
|
|
"""Base class for all LLM exceptions."""
|
|
|
|
|
|
2025-09-15 13:06:33 +08:00
|
|
|
description: str | None = None
|
2024-08-26 19:36:44 +08:00
|
|
|
|
2025-09-15 13:06:33 +08:00
|
|
|
def __init__(self, description: str | None = None):
|
2024-08-26 19:36:44 +08:00
|
|
|
self.description = description
|
|
|
|
|
|
|
|
|
|
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"
|