MemGPT/memgpt/errors.py
Charles Packer dcf746cd91
feat: one time pass of autoflake + add autoflake to dev extras (#1097)
Co-authored-by: tombedor <tombedor@gmail.com>
2024-03-05 16:35:12 -08:00

27 lines
820 B
Python

class LLMError(Exception):
"""Base class for all LLM-related errors."""
class LLMJSONParsingError(LLMError):
"""Exception raised for errors in the JSON parsing process."""
def __init__(self, message="Error parsing JSON generated by LLM"):
self.message = message
super().__init__(self.message)
class LocalLLMError(LLMError):
"""Generic catch-all error for local LLM problems"""
def __init__(self, message="Encountered an error while running local LLM"):
self.message = message
super().__init__(self.message)
class LocalLLMConnectionError(LLMError):
"""Error for when local LLM cannot be reached with provided IP/port"""
def __init__(self, message="Could not connect to local LLM"):
self.message = message
super().__init__(self.message)