error.py 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # -*- coding:utf-8 -*-
  2. from libs.exception import BaseHTTPException
  3. class AppUnavailableError(BaseHTTPException):
  4. error_code = 'app_unavailable'
  5. description = "App unavailable."
  6. code = 400
  7. class NotCompletionAppError(BaseHTTPException):
  8. error_code = 'not_completion_app'
  9. description = "Not Completion App"
  10. code = 400
  11. class NotChatAppError(BaseHTTPException):
  12. error_code = 'not_chat_app'
  13. description = "Not Chat App"
  14. code = 400
  15. class ConversationCompletedError(BaseHTTPException):
  16. error_code = 'conversation_completed'
  17. description = "Conversation Completed."
  18. code = 400
  19. class ProviderNotInitializeError(BaseHTTPException):
  20. error_code = 'provider_not_initialize'
  21. description = "Provider Token not initialize."
  22. code = 400
  23. class ProviderQuotaExceededError(BaseHTTPException):
  24. error_code = 'provider_quota_exceeded'
  25. description = "Provider quota exceeded."
  26. code = 400
  27. class ProviderModelCurrentlyNotSupportError(BaseHTTPException):
  28. error_code = 'model_currently_not_support'
  29. description = "GPT-4 currently not support."
  30. code = 400
  31. class CompletionRequestError(BaseHTTPException):
  32. error_code = 'completion_request_error'
  33. description = "Completion request failed."
  34. code = 400