com.launchableinc.openai.OpenAiHttpException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api Show documentation
Show all versions of api Show documentation
Basic java objects for the OpenAI GPT APIs
package com.launchableinc.openai;
public class OpenAiHttpException extends RuntimeException {
/**
* HTTP status code
*/
public final int statusCode;
/**
* OpenAI error code, for example "invalid_api_key"
*/
public final String code;
public final String param;
/**
* OpenAI error type, for example "invalid_request_error"
* https://platform.openai.com/docs/guides/error-codes/python-library-error-types
*/
public final String type;
public OpenAiHttpException(OpenAiError error, Exception parent, int statusCode) {
super(error.error.message, parent);
this.statusCode = statusCode;
this.code = error.error.code;
this.param = error.error.param;
this.type = error.error.type;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy