Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ERR_NIL = NewError(500, -1, "", "fastapi_error") ERR_UNKNOWN = NewError(500, -1, "Unknown Error", "fastapi_error") ERR_INTERNAL_ERROR = NewError(500, 500, "Internal Error", "fastapi_error") ERR_NO_AVAILABLE_KEY = NewError(500, "fastapi_error", "No available key", "fastapi_error") ERR_NO_AVAILABLE_MODEL_AGENT = NewError(500, "fastapi_error", "No available model agent", "fastapi_error") ERR_NO_AVAILABLE_MODEL_AGENT_KEY = NewError(500, "fastapi_error", "No available model agent key", "fastapi_error") ERR_NOT_AUTHORIZED = NewError(403, "fastapi_error", "Not Authorized", "fastapi_error") ERR_NOT_FOUND = NewError(404, "unknown_url", "Unknown request URL", "invalid_request_error") ERR_NOT_API_KEY = NewError(401, "invalid_request_error", "You didn't provide an API key.", "invalid_request_error") ERR_INVALID_API_KEY = NewError(401, "invalid_api_key", "Incorrect API key provided or has been disabled.", "fastapi_request_error") ERR_API_KEY_DISABLED = NewError(401, "api_key_disabled", "Key has been disabled.", "fastapi_request_error") ERR_INVALID_USER = NewError(401, "invalid_user", "User does not exist or has been disabled.", "fastapi_request_error") ERR_USER_DISABLED = NewError(401, "user_disabled", "User has been disabled.", "fastapi_request_error") ERR_INVALID_APP = NewError(401, "invalid_app", "App does not exist or has been disabled.", "fastapi_request_error") ERR_APP_DISABLED = NewError(401, "app_disabled", "App has been disabled.", "fastapi_error") ERR_MODEL_NOT_FOUND = NewError(404, "model_not_found", "The model does not exist or you do not have access to it.", "fastapi_request_error") ERR_MODEL_DISABLED = NewError(401, "model_disabled", "Model has been disabled.", "fastapi_request_error") ERR_INSUFFICIENT_QUOTA = NewError(429, "insufficient_quota", "You exceeded your current quota.", "insufficient_quota") )
Functions ¶
Types ¶
type FastAPIError ¶
type FastAPIError struct {
Err *openai.APIError `json:"error,omitempty"`
}
func (*FastAPIError) ErrCode ¶
func (e *FastAPIError) ErrCode() any
func (*FastAPIError) ErrMessage ¶
func (e *FastAPIError) ErrMessage() string
func (*FastAPIError) ErrType ¶
func (e *FastAPIError) ErrType() string
func (*FastAPIError) Error ¶
func (e *FastAPIError) Error() string
func (*FastAPIError) Status ¶
func (e *FastAPIError) Status() int
func (*FastAPIError) Unwrap ¶
func (e *FastAPIError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.