You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
10 months ago | |
|---|---|---|
| lib | 10 months ago | |
| src/dev/qbin/gaiji | 10 months ago | |
| .classpath | 10 months ago | |
| .gitignore | 10 months ago | |
| .project | 11 months ago | |
| LICENSE | 11 months ago | |
| README.md | 10 months ago | |
| logo.png | 11 months ago | |
README.md
Gaiji -- the Java OpenAI interface
Name
The name was generated by GPT-3.
Getting started
Simple completion example
public static main(String[] args) {
// Instantiate a GPT3 adapter object
GPT3 gpt = new GPT3("API-TOKEN");
// Initialize API
OpenAiAPI api = new OpenAiAPI(config.getApiToken());
// Build request
CompletionRequest request = new OpenAiRequest.CompletionRequestBuilder().
setPrompt("Hello how are you?\n").
setTemperature(0.7D).
setModel("text-davinci-002").build();
// Execute request
Completion completion = api.createCompletion(request);
// Print out result
System.out.println(completion.choices[0].text);
}
Features
OpenAiAPI - OpenAi API adapter
- List all engines (
getEngines()) - Access the fine-tune (jobs) (
getFineTunes/getFineTune) - Create, cancel and delete fine-tunes/models (
createFineTune/cancelFineTune/deleteFineTune) - Upload file to the file api (
uploadFile)
OpenAiObject - OpenAi json object wrapper collection
Currently supported:
- File
- List of files
- Finetune
- List of finetunes
- Engine
- List of engines