Enum OpenAiErrorType

java.lang.Object
java.lang.Enum<OpenAiErrorType>
com.chatmotorapi.api.OpenAiErrorType
All Implemented Interfaces:
Serializable, Comparable<OpenAiErrorType>, java.lang.constant.Constable

public enum OpenAiErrorType
extends Enum<OpenAiErrorType>
Enum representing the various error messages returned by the ChatGPT API. Each enum value corresponds to a specific type of error that can occur when interacting with the API.

NO_OPENAI_ERROR if the error message does not come from the OpenAI API.
  • Enum Constant Details

    • NO_OPENAI_ERROR

      public static final OpenAiErrorType NO_OPENAI_ERROR
      Error type indicating that no OpenAI error occurred. This is the default error type if no other error type applies.
    • INVALID_AUTHENTICATION

      public static final OpenAiErrorType INVALID_AUTHENTICATION
      Error type indicating that the provided API key is invalid. Ensure that the API key is correct and active.
    • INTERNAL_ERROR

      public static final OpenAiErrorType INTERNAL_ERROR
      Error type indicating that an internal error occurred at OpenAI. (Examples of internal errors include: timeout, server error, etc.)
    • INCORRECT_API_KEY

      public static final OpenAiErrorType INCORRECT_API_KEY
      Error type indicating that the provided API key is incorrect. Ensure that the API key is correct.
    • MEMBERSHIP_REQUIRED

      public static final OpenAiErrorType MEMBERSHIP_REQUIRED
      Error type indicating that the account must be a member of an organization. Contact support or your organization admin to resolve.
    • REGION_NOT_SUPPORTED

      public static final OpenAiErrorType REGION_NOT_SUPPORTED
      Error type indicating that the request is coming from an unsupported country, region, or territory. Check the supported regions documentation.
    • RATE_LIMIT_REACHED

      public static final OpenAiErrorType RATE_LIMIT_REACHED
      Error type indicating that the request rate limit has been reached. Wait for some time before making further requests.
    • RATE_LIMIT_EXCEEDED

      public static final OpenAiErrorType RATE_LIMIT_EXCEEDED
      Error type indicating that the request rate limit has been reached. Wait for some time before making further requests.
    • QUOTA_EXCEEDED

      public static final OpenAiErrorType QUOTA_EXCEEDED
      Error type indicating that the account has insufficient quota for the request. Typically occurs when the usage limit has been reached.
    • INSUFFICIENT_QUOTA

      public static final OpenAiErrorType INSUFFICIENT_QUOTA
      Error type indicating that the account has insufficient quota for the request. Typically occurs when the usage limit has been reached.
    • SERVER_ERROR

      public static final OpenAiErrorType SERVER_ERROR
      Error type indicating that an internal server error occurred. Retry the request after some time.
    • ENGINE_OVERLOADED

      public static final OpenAiErrorType ENGINE_OVERLOADED
      Error type indicating that the engine is currently overloaded. Retry the request after some time.
    • INVALID_REQUEST_ERROR

      public static final OpenAiErrorType INVALID_REQUEST_ERROR
      Error type indicating that the request format is incorrect. Check the request parameters and JSON format.
    • UNAUTHORIZED

      public static final OpenAiErrorType UNAUTHORIZED
      Error type indicating that the request is unauthorized. Verify the API key and permissions.
    • VALIDATION_ERROR

      public static final OpenAiErrorType VALIDATION_ERROR
      Error type indicating that the input data did not pass validation checks. Ensure that all required fields are correctly filled.
    • TOKENS

      public static final OpenAiErrorType TOKENS
      Error type indicating that the number of tokens requested exceeds the allowed limit. Reduce the input or output tokens to meet the limits.
    • CF_GATEWAY_TIMEOUT

      public static final OpenAiErrorType CF_GATEWAY_TIMEOUT
      Error type indicating that the request is throttled. Wait for some time before making further requests.
    • UNKNOWN_ERROR

      public static final OpenAiErrorType UNKNOWN_ERROR
      Error type indicating an unknown error. This is a fallback for unrecognized errors.
  • Method Details

    • values

      public static OpenAiErrorType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static OpenAiErrorType valueOf​(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null