IntelliJava V0.3
IntelliJava allows java developers to easily integrate with the latest language models and deep learning frameworks using few lines of java code. The first version supports only Openai APIs. It provides a simple and intuitive API with convenient methods for sending text input to models like (GPT-3 and DALL·E) and receiving generated text or images in return.
- Import the core jar file to your project or add the maven package (check Integration section).
- Add gson dependency using maven or the jar file (check dependencies section).
- Call the
RemoteLanguageModelfor the language model andRemoateImageModelfor image generation.
For jar integration download: intellijava.jar.
For maven: Add github dependency package.
For ready integration: try the sample_code.
Language model code (2 steps):
// 1- initiate the remote language model String apiKey = "<add-openai-api-key>"; RemoteLanguageModel langModel = new RemoteLanguageModel(apiKey, "openai"); // 2- call generateText with any command ! String command = "return a java code that says hello wrold"; String resValue = langModel.generateText("text-davinci-002", command, 0.5F, 100); Output: System.out.println("Hello, World!");
Image generation code (2 steps):
// 1- initiate the remote image model RemoateImageModel imageModel = new RemoateImageModel(apiKey, "openai"); // 2- call generateImages with any command ! String prompt = "teddy writing a blog in times square"; List<String> images = imageModel.generateImages(prompt, 2/*number of images*/, "1024x1024"); For full example check the code inside sample_code project.
The only dependencies is GSON.
For Maven:
<dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> <version>2.8.9</version> </dependency> For Gradle:
dependencies{implementation 'com.google.code.gson:gson:2.8.9' } For jar download: gson download repo
Call for contributors:
- Add support to OpenAI Completion API.
- Add support to OpenAI DALL·E 2.
- Add support to other OpenAI functions.
- Add support to Google language models.
- Add support to Amazon language models.
- Add support to Midjourney image generation.
Apache License
Copyright 2023 Github.com/Barqawiz/IntelliJava
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

