- Introduction of dynamic Processors - Introduction of caching system - Introduction of a better template manager - Adaptation of ModelVariables to support dynamic Processors / Retrievers / Specialists - Start adaptation of chat client
51 lines
1.6 KiB
Python
51 lines
1.6 KiB
Python
class EveAIException(Exception):
|
|
"""Base exception class for EveAI API"""
|
|
|
|
def __init__(self, message, status_code=400, payload=None):
|
|
super().__init__()
|
|
self.message = message
|
|
self.status_code = status_code
|
|
self.payload = payload
|
|
|
|
def to_dict(self):
|
|
rv = dict(self.payload or ())
|
|
rv['message'] = self.message
|
|
rv['error'] = self.__class__.__name__
|
|
return rv
|
|
|
|
|
|
class EveAIInvalidLanguageException(EveAIException):
|
|
"""Raised when an invalid language is provided"""
|
|
|
|
def __init__(self, message="Langage is required", status_code=400, payload=None):
|
|
super().__init__(message, status_code, payload)
|
|
|
|
|
|
class EveAIDoubleURLException(EveAIException):
|
|
"""Raised when an existing url is provided"""
|
|
|
|
def __init__(self, message="URL already exists", status_code=400, payload=None):
|
|
super().__init__(message, status_code, payload)
|
|
|
|
|
|
class EveAIUnsupportedFileType(EveAIException):
|
|
"""Raised when an invalid file type is provided"""
|
|
|
|
def __init__(self, message="Filetype is not supported", status_code=400, payload=None):
|
|
super().__init__(message, status_code, payload)
|
|
|
|
|
|
class EveAINoLicenseForTenant(EveAIException):
|
|
"""Raised when no active license for a tenant is provided"""
|
|
|
|
def __init__(self, message="No license for tenant found", status_code=400, payload=None):
|
|
super().__init__(message, status_code, payload)
|
|
|
|
|
|
class EveAITenantNotFound(EveAIException):
|
|
"""Raised when a tenant is not found"""
|
|
|
|
def __init__(self, message="Tenant not found", status_code=400, payload=None):
|
|
super().__init__(message, status_code, payload)
|
|
|