Gaiji is a java library which allows the interaction with the OpenAI API. Mainly focusing on GPT3 and model fine tuning.
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.
qbinary 176a4935b4
Update 'README.md'
10 months ago
lib Add Apache commons http stuff 10 months ago
src/dev/qbin/gaiji Clean up 10 months ago
.classpath Add Apache commons http stuff 10 months ago
.gitignore Implement upload file 10 months ago
.project Initial Commit 11 months ago
LICENSE Initial Commit 11 months ago
README.md Update 'README.md' 10 months ago
logo.png Antialiase logo 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