| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| IntelliJava 0.8.0.tar.gz | 2023-03-04 | 3.0 MB | |
| IntelliJava 0.8.0.zip | 2023-03-04 | 3.0 MB | |
| README.md | 2023-03-04 | 1.5 kB | |
| Totals: 3 Items | 6.0 MB | 0 | |
Introducing the latest update to Intelligent Java with support for ChatGPT model :rocket:.
Update summary:
- Support ChatGPT :robot:.
- Update the SpeechInput name to become Text2SpeechInput.
- Add enum input type to the image model.
Integration
Maven:
:::xml
<dependency>
<groupId>io.github.barqawiz</groupId>
<artifactId>intellijava.core</artifactId>
<version>0.8.0</version>
</dependency>
Gradle:
implementation 'io.github.barqawiz:intellijava.core:0.8.0'
Example
ChatGPT code:
:::java
// 1- initiate the chat model.
Chatbot bot = new Chatbot(apiKey, SupportedChatModels.openai);
// 2- prepare the chat history by calling addMessage.
String mode = "You are a helpful astronomy assistant.";
ChatModelInput input = new ChatGPTInput.Builder(mode).addUserMessage("what is the space between moon and earth").build();
// 3- call chat!
List<String> resValues = bot.chat(input);
Output:The average distance between the Moon and the Earth is about 238,855 miles (384,400 kilometers).
Text to speech code:
:::java
// 1- initiate the remote speech model
RemoteSpeechModel model = new RemoteSpeechModel(apiKey, SpeechModels.google);
// 2- call generateEnglishText with any text
Text2SpeechInput input = new Text2SpeechInput.Builder("Hi, I am Intelligent Java.").build();
byte[] decodedAudio = model.generateEnglishText(input);