mirror of
https://github.com/cpacker/MemGPT.git
synced 2025-06-03 04:30:22 +00:00
27 lines
820 B
Python
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)
|