Skip to content

Commit ba48734

Browse files
committed
update documentation
1 parent 88ac595 commit ba48734

File tree

1 file changed

+25
-8
lines changed

1 file changed

+25
-8
lines changed

README.md

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@
2020
</p>
2121

2222
# Intelligent Java
23-
Intelligent java (IntelliJava) is the ultimate tool to integrate with the latest language models and deep learning frameworks using java. The library provides an intuitive functions for sending input to models like GPT-3 and DALL·E, and receiving generated text, speech or images. With just a few lines of code, you can easily access the power of cutting-edge AI models to enhance your projects.
23+
Intelligent java (IntelliJava) is the ultimate tool to integrate with the latest language models and deep learning frameworks using java. The library provides an intuitive functions for sending input to models like ChatGPT and DALL·E, and receiving generated text, speech or images. With just a few lines of code, you can easily access the power of cutting-edge AI models to enhance your projects.
2424

2525
The supported models:
26-
- **OpenAI**: Access GPT-3 to generate text and DALL·E to generate images. OpenAI is preferred for quality results without tuning.
26+
- **OpenAI**: Access ChatGPT, GPT3 to generate text and DALL·E to generate images. OpenAI is preferred for quality results without tuning.
2727
- **Cohere.ai**: Generate text; Cohere allows you to custom your language model to suit your specific needs.
2828
- **Google AI**: Generate audio from text; Access DeepMind’s speech models.
2929

3030
# How to use
3131

3232
1. Add the maven dependency or import the core jar file (check the Integration section).
3333
2. Add Gson dependency if using the jar file; otherwise, it's handled by maven or Gradle.
34-
3. Call the ``RemoteLanguageModel`` for the language models, ``RemoteImageModel`` for image generation and ``RemoteSpeechModel`` for text to speech models.
34+
3. Call the ``RemoteLanguageModel`` for the language models, ``RemoteImageModel`` for image generation and ``RemoteSpeechModel`` for text to speech models, ``Chatbot`` for ChatGPT.
3535

3636
## Integration
3737
The package released to Maven Central Repository:
@@ -41,23 +41,23 @@ Maven:
4141
<dependency>
4242
<groupId>io.github.barqawiz</groupId>
4343
<artifactId>intellijava.core</artifactId>
44-
<version>0.7.0</version>
44+
<version>0.8.0</version>
4545
</dependency>
4646
```
4747

4848
Gradle:
4949

5050
```
51-
implementation 'io.github.barqawiz:intellijava.core:0.7.0'
51+
implementation 'io.github.barqawiz:intellijava.core:0.8.0'
5252
```
5353

5454
Gradle(Kotlin):
5555
```
56-
implementation("io.github.barqawiz:intellijava.core:0.7.0")
56+
implementation("io.github.barqawiz:intellijava.core:0.8.0")
5757
```
5858

5959
Jar download:
60-
[intellijava.jar](https://repo1.maven.org/maven2/io/github/barqawiz/intellijava.core/0.7.0/intellijava.core-0.7.0.jar).
60+
[intellijava.jar](https://repo1.maven.org/maven2/io/github/barqawiz/intellijava.core/0.8.0/intellijava.core-0.8.0.jar).
6161

6262
## Code Example
6363
**Language model code** (2 steps):
@@ -100,7 +100,24 @@ Output:<br>
100100
// save temporary audio file for testing
101101
AudioHelper.saveTempAudio(decodedAudio);
102102
```
103+
<br><br>
104+
**ChatGPT code**:
105+
```java
106+
// 1- initiate the chat model.
107+
Chatbot bot = new Chatbot(apiKey, SupportedChatModels.openai);
108+
109+
// 2- prepare the chat history by calling addMessage.
110+
String mode = "You are a helpful astronomy assistant.";
111+
ChatModelInput input = new ChatGPTInput.Builder(mode)
112+
.addUserMessage("what is the space between moon and earth")
113+
.build();
114+
115+
// 3- call chat!
116+
List<String> resValues = bot.chat(input);
117+
```
118+
Output:``` The average distance between the Moon and the Earth is about 238,855 miles (384,400 kilometers). ```
103119

120+
<br>
104121
For full examples and ready integration try [the sample_code](https://github.com/Barqawiz/IntelliJava/tree/main/sample_code).
105122

106123
## Third-party dependencies
@@ -116,7 +133,7 @@ For jar download:
116133

117134
# Roadmap
118135
Call for contributors:
119-
- [x] Add support to OpenAI Completion API.
136+
- [x] Add support to OpenAI Completion.
120137
- [x] Add support to OpenAI DALL·E 2.
121138
- [ ] Add support to other OpenAI functions.
122139
- [x] Add support to cohere generate API.

0 commit comments

Comments
 (0)