Team Ai
Apppublic

Underground-Digital/Workflow-Engine

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
error.py136 linesDownload Raw Back to web
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 Workflow 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 AppMoreLikeThisDisabledError(BaseHTTPException):65    error_code = "app_more_like_this_disabled"66    description = "The 'More like this' feature is disabled. Please refresh your page."67    code = 40368 69 70class AppSuggestedQuestionsAfterAnswerDisabledError(BaseHTTPException):71    error_code = "app_suggested_questions_after_answer_disabled"72    description = "The 'Suggested Questions After Answer' feature is disabled. Please refresh your page."73    code = 40374 75 76class NoAudioUploadedError(BaseHTTPException):77    error_code = "no_audio_uploaded"78    description = "Please upload your audio."79    code = 40080 81 82class AudioTooLargeError(BaseHTTPException):83    error_code = "audio_too_large"84    description = "Audio size exceeded. {message}"85    code = 41386 87 88class UnsupportedAudioTypeError(BaseHTTPException):89    error_code = "unsupported_audio_type"90    description = "Audio type not allowed."91    code = 41592 93 94class ProviderNotSupportSpeechToTextError(BaseHTTPException):95    error_code = "provider_not_support_speech_to_text"96    description = "Provider not support speech to text."97    code = 40098 99 100class NoFileUploadedError(BaseHTTPException):101    error_code = "no_file_uploaded"102    description = "Please upload your file."103    code = 400104 105 106class TooManyFilesError(BaseHTTPException):107    error_code = "too_many_files"108    description = "Only one file is allowed."109    code = 400110 111 112class FileTooLargeError(BaseHTTPException):113    error_code = "file_too_large"114    description = "File size exceeded. {message}"115    code = 413116 117 118class UnsupportedFileTypeError(BaseHTTPException):119    error_code = "unsupported_file_type"120    description = "File type not allowed."121    code = 415122 123 124class WebSSOAuthRequiredError(BaseHTTPException):125    error_code = "web_sso_auth_required"126    description = "Web SSO authentication required."127    code = 401128 129 130class InvokeRateLimitError(BaseHTTPException):131    """Raised when the Invoke returns rate limit error."""132 133    error_code = "rate_limit_error"134    description = "Rate Limit Error"135    code = 429136