Package com.chatmotorapi.api
Enum 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.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants Enum Constant Description CF_GATEWAY_TIMEOUT
Error type indicating that the request is throttled.ENGINE_OVERLOADED
Error type indicating that the engine is currently overloaded.INCORRECT_API_KEY
Error type indicating that the provided API key is incorrect.INSUFFICIENT_QUOTA
Error type indicating that the account has insufficient quota for the request.INTERNAL_ERROR
Error type indicating that an internal error occurred at OpenAI.INVALID_AUTHENTICATION
Error type indicating that the provided API key is invalid.INVALID_REQUEST_ERROR
Error type indicating that the request format is incorrect.MEMBERSHIP_REQUIRED
Error type indicating that the account must be a member of an organization.NO_OPENAI_ERROR
Error type indicating that no OpenAI error occurred.QUOTA_EXCEEDED
Error type indicating that the account has insufficient quota for the request.RATE_LIMIT_EXCEEDED
Error type indicating that the request rate limit has been reached.RATE_LIMIT_REACHED
Error type indicating that the request rate limit has been reached.REGION_NOT_SUPPORTED
Error type indicating that the request is coming from an unsupported country, region, or territory.SERVER_ERROR
Error type indicating that an internal server error occurred.TOKENS
Error type indicating that the number of tokens requested exceeds the allowed limit.UNAUTHORIZED
Error type indicating that the request is unauthorized.UNKNOWN_ERROR
Error type indicating an unknown error.VALIDATION_ERROR
Error type indicating that the input data did not pass validation checks. -
Method Summary
Modifier and Type Method Description static OpenAiErrorType
valueOf(String name)
Returns the enum constant of this type with the specified name.static OpenAiErrorType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
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
Error type indicating that the provided API key is invalid. Ensure that the API key is correct and active. -
INTERNAL_ERROR
Error type indicating that an internal error occurred at OpenAI. (Examples of internal errors include: timeout, server error, etc.) -
INCORRECT_API_KEY
Error type indicating that the provided API key is incorrect. Ensure that the API key is correct. -
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
Error type indicating that the request is coming from an unsupported country, region, or territory. Check the supported regions documentation. -
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
Error type indicating that the request rate limit has been reached. Wait for some time before making further requests. -
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
Error type indicating that the account has insufficient quota for the request. Typically occurs when the usage limit has been reached. -
SERVER_ERROR
Error type indicating that an internal server error occurred. Retry the request after some time. -
ENGINE_OVERLOADED
Error type indicating that the engine is currently overloaded. Retry the request after some time. -
INVALID_REQUEST_ERROR
Error type indicating that the request format is incorrect. Check the request parameters and JSON format. -
UNAUTHORIZED
Error type indicating that the request is unauthorized. Verify the API key and permissions. -
VALIDATION_ERROR
Error type indicating that the input data did not pass validation checks. Ensure that all required fields are correctly filled. -
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
Error type indicating that the request is throttled. Wait for some time before making further requests. -
UNKNOWN_ERROR
Error type indicating an unknown error. This is a fallback for unrecognized errors.
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-