IntelliJava V0.6.0
We are excited to announce the release of IntelliJava V0.6.0, which includes support for Cohere.ai, a language model that allows developers to tailor their models to their specific needs. This new version also includes enhancements to the library's API, making it even more flexible for integration with future models.
Maven:
<dependency>
<groupId>io.github.barqawiz</groupId>
<artifactId>intellijava.core</artifactId>
<version>0.6.0</version>
</dependency>
Openai access:
// 1- initiate the remote language model
String apiKey = "<add-openai-api-key>";
RemoteLanguageModel langModel = new RemoteLanguageModel(apiKey, "openai");
// 2- call generateText with any command !
LanguageModelInput langInput = new LanguageModelInput.Builder("return a java code that says hello world")
.setModel("text-davinci-002").setTemperature(0.7f).setMaxTokens(50).build();
String resValue = langModel.generateText(langInput);
Cohere.ai access
// 1- initiate the remote language model
String apiKey = "<add-cohere-api-key>";
RemoteLanguageModel langModel = new RemoteLanguageModel(apiKey, "cohere");
// 2- call generateText with any command !
LanguageModelInput langInput = new LanguageModelInput.Builder("Once upon a time in a magical land called")
.setModel("xlarge").setTemperature(0.7f).setMaxTokens(50).build();
String resValue = langModel.generateText(langInput);