Team Ai
Apppublic

Underground-Digital/Workflow-Engine

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
error.py110 linesDownload Raw Back to app
1from libs.exception import BaseHTTPException2 3 4class AppUnavailableError(BaseHTTPException):5    error_code = "app_unavailable"6    description = "App unavailable, please check your app configurations."7    code = 4008 9 10class NotCompletionAppError(BaseHTTPException):11    error_code = "not_completion_app"12    description = "Please check if your Completion app mode matches the right API route."13    code = 40014 15 16class NotChatAppError(BaseHTTPException):17    error_code = "not_chat_app"18    description = "Please check if your app mode matches the right API route."19    code = 40020 21 22class NotWorkflowAppError(BaseHTTPException):23    error_code = "not_workflow_app"24    description = "Please check if your app mode matches the right API route."25    code = 40026 27 28class ConversationCompletedError(BaseHTTPException):29    error_code = "conversation_completed"30    description = "The conversation has ended. Please start a new conversation."31    code = 40032 33 34class ProviderNotInitializeError(BaseHTTPException):35    error_code = "provider_not_initialize"36    description = (37        "No valid model provider credentials found. "38        "Please go to Settings -> Model Provider to complete your provider credentials."39    )40    code = 40041 42 43class ProviderQuotaExceededError(BaseHTTPException):44    error_code = "provider_quota_exceeded"45    description = (46        "Your quota for Dify Hosted OpenAI has been exhausted. "47        "Please go to Settings -> Model Provider to complete your own provider credentials."48    )49    code = 40050 51 52class ProviderModelCurrentlyNotSupportError(BaseHTTPException):53    error_code = "model_currently_not_support"54    description = "Dify Hosted OpenAI trial currently not support the GPT-4 model."55    code = 40056 57 58class CompletionRequestError(BaseHTTPException):59    error_code = "completion_request_error"60    description = "Completion request failed."61    code = 40062 63 64class NoAudioUploadedError(BaseHTTPException):65    error_code = "no_audio_uploaded"66    description = "Please upload your audio."67    code = 40068 69 70class AudioTooLargeError(BaseHTTPException):71    error_code = "audio_too_large"72    description = "Audio size exceeded. {message}"73    code = 41374 75 76class UnsupportedAudioTypeError(BaseHTTPException):77    error_code = "unsupported_audio_type"78    description = "Audio type not allowed."79    code = 41580 81 82class ProviderNotSupportSpeechToTextError(BaseHTTPException):83    error_code = "provider_not_support_speech_to_text"84    description = "Provider not support speech to text."85    code = 40086 87 88class NoFileUploadedError(BaseHTTPException):89    error_code = "no_file_uploaded"90    description = "Please upload your file."91    code = 40092 93 94class TooManyFilesError(BaseHTTPException):95    error_code = "too_many_files"96    description = "Only one file is allowed."97    code = 40098 99 100class FileTooLargeError(BaseHTTPException):101    error_code = "file_too_large"102    description = "File size exceeded. {message}"103    code = 413104 105 106class UnsupportedFileTypeError(BaseHTTPException):107    error_code = "unsupported_file_type"108    description = "File type not allowed."109    code = 415110