Package io.github.sashirestela.openai
Class SimpleOpenAI
- java.lang.Object
-
- io.github.sashirestela.openai.SimpleOpenAI
-
-
Field Summary
Fields Modifier and Type Field Description String
AUTHORIZATION_HEADER
String
BEARER_AUTHORIZATION
-
Constructor Summary
Constructors Constructor Description SimpleOpenAI(String apiKey, String organizationId, String urlBase, HttpClient httpClient)
Constructor used to generate a builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OpenAI.Audios
audios()
Generates an implementation of the Audios interface to handle requests.OpenAI.ChatCompletions
chatCompletions()
Generates an implementation of the ChatCompletions interface to handle requests.OpenAI.Completions
completions()
Generates an implementation of the Completions interface to handle requests.OpenAI.Embeddings
embeddings()
Generates an implementation of the Embeddings interface to handle requests.OpenAI.Files
files()
Generates an implementation of the Files interface to handle requests.OpenAI.FineTunings
fineTunings()
Generates an implementation of the FineTunings interface to handle requests.OpenAI.Images
images()
Generates an implementation of the Images interface to handle requests.OpenAI.Models
models()
Generates an implementation of the Models interface to handle requests.OpenAI.Moderations
moderations()
Generates an implementation of the Moderations interface to handle requests.
-
-
-
Field Detail
-
AUTHORIZATION_HEADER
public final String AUTHORIZATION_HEADER
- See Also:
- Constant Field Values
-
BEARER_AUTHORIZATION
public final String BEARER_AUTHORIZATION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SimpleOpenAI
public SimpleOpenAI(String apiKey, String organizationId, String urlBase, HttpClient httpClient)
Constructor used to generate a builder.- Parameters:
apiKey
- Identifier to be used for authentication. Mandatory.organizationId
- Organization's id to be charged for usage. Optional.urlBase
- Host's url, If not provided, it'll be https://api.openai.com. Optional.httpClient
- AHttpClient
object. One is created by default if not provided. Optional.
-
-
Method Detail
-
audios
public OpenAI.Audios audios()
Generates an implementation of the Audios interface to handle requests.- Returns:
- An instance of the interface. It is created only once.
-
chatCompletions
public OpenAI.ChatCompletions chatCompletions()
Generates an implementation of the ChatCompletions interface to handle requests.- Returns:
- An instance of the interface. It is created only once.
-
completions
public OpenAI.Completions completions()
Generates an implementation of the Completions interface to handle requests.- Returns:
- An instance of the interface. It is created only once.
-
embeddings
public OpenAI.Embeddings embeddings()
Generates an implementation of the Embeddings interface to handle requests.- Returns:
- An instance of the interface. It is created only once.
-
files
public OpenAI.Files files()
Generates an implementation of the Files interface to handle requests.- Returns:
- An instance of the interface. It is created only once.
-
images
public OpenAI.Images images()
Generates an implementation of the Images interface to handle requests.- Returns:
- An instance of the interface. It is created only once.
-
models
public OpenAI.Models models()
Generates an implementation of the Models interface to handle requests.- Returns:
- An instance of the interface. It is created only once.
-
moderations
public OpenAI.Moderations moderations()
Generates an implementation of the Moderations interface to handle requests.- Returns:
- An instance of the interface. It is created only once.
-
fineTunings
public OpenAI.FineTunings fineTunings()
Generates an implementation of the FineTunings interface to handle requests.- Returns:
- An instance of the interface. It is created only once.
-
-