Skip to content

Commit 630c9a8

Browse files
Merge pull request #93 from intelligentnode/81-add-support-for-gemini-model
81 add support for gemini model
2 parents e5a23b4 + 2c9f4f8 commit 630c9a8

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

IntelliNode/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ const { Chatbot, ChatGPTInput } = require('intellinode');
4141
```
4242
2. call:
4343
```js
44-
// set the system mode and the user message.
44+
// set chatGPT system mode and the user message.
4545
const input = new ChatGPTInput('You are a helpful assistant.');
4646
input.addUserMessage('What is the distance between the Earth and the Moon?');
4747

48-
// get the responses from the chatbot
48+
// get chatGPT responses.
4949
const bot = new Chatbot(apiKey);
5050
const responses = await bot.chat(input);
5151
```

IntelliNode/model/input/ChatModelInput.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,10 @@ class GeminiInput extends ChatModelInput {
201201
});
202202
}
203203

204+
addAssistantMessage(text) {
205+
this.addModelMessage(text);
206+
}
207+
204208
getChatInput() {
205209
return {
206210
contents: this.messages

IntelliNode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "intellinode",
3-
"version": "1.7.6",
3+
"version": "1.7.7",
44
"description": "Integrate and evaluate various AI models, such as ChatGPT, Llama, Diffusion, Cohere, Gemini and Hugging Face.",
55
"main": "index.js",
66
"keywords": [

IntelliNode/test/integration/Chatbot.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ async function testGeminiChatCase2() {
271271

272272
// add inputs
273273
geminiInput.addUserMessage("Write the first line of a story about a magic backpack.");
274-
geminiInput.addModelMessage("In the bustling city of Meadow brook, lived a young girl named Sophie. She was a bright and curious soul with an imaginative mind.");
274+
geminiInput.addAssistantMessage("In the bustling city of Meadow brook, lived a young girl named Sophie. She was a bright and curious soul with an imaginative mind.");
275275
geminiInput.addUserMessage("Can you set it in a quiet village in 1600s France?");
276276

277277
const responses = await geminiBot.chat(geminiInput);

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Unified prompt, evaluation, and production integration to any large model
2929

3030
# Intelligent Node
3131

32-
IntelliNode is a javascript module that integrates cutting-edge AI into your project. With its intuitive functions, you can easily feed data to models like **ChatGPT**, **LLaMA**, **WaveNet**, and **Stable diffusion** and receive generated text, speech, or images. It also offers high-level functions such as semantic search, multi-model evaluation, and chatbot capabilities.
32+
IntelliNode is a javascript module that integrates cutting-edge AI into your project. With its intuitive functions, you can easily feed data to models like **ChatGPT**, **LLaMA**, **WaveNet**, **Gemini** and **Stable diffusion** and receive generated text, speech, or images. It also offers high-level functions such as semantic search, multi-model evaluation, and chatbot capabilities.
3333

3434
# Access the module
3535
## Install
@@ -63,11 +63,11 @@ const { Chatbot, ChatGPTInput } = require('intellinode');
6363
```
6464
call:
6565
```js
66-
// set the system mode and the user message.
66+
// set chatGPT system mode and the user message.
6767
const input = new ChatGPTInput('You are a helpful assistant.');
6868
input.addUserMessage('What is the distance between the Earth and the Moon?');
6969

70-
// get the responses from the chatbot
70+
// get chatGPT responses.
7171
const chatbot = new Chatbot(OPENAI_API_KEY, 'openai');
7272
const responses = await chatbot.chat(input);
7373
```

0 commit comments

Comments
 (0)