Skip to content

Commit

Permalink
Merge pull request #93 from intelligentnode/81-add-support-for-gemini…
Browse files Browse the repository at this point in the history
…-model

81 add support for gemini model
  • Loading branch information
intelligentnode authored Jan 11, 2024
2 parents e5a23b4 + 2c9f4f8 commit 630c9a8
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions IntelliNode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ const { Chatbot, ChatGPTInput } = require('intellinode');
```
2. call:
```js
// set the system mode and the user message.
// set chatGPT system mode and the user message.
const input = new ChatGPTInput('You are a helpful assistant.');
input.addUserMessage('What is the distance between the Earth and the Moon?');

// get the responses from the chatbot
// get chatGPT responses.
const bot = new Chatbot(apiKey);
const responses = await bot.chat(input);
```
Expand Down
4 changes: 4 additions & 0 deletions IntelliNode/model/input/ChatModelInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ class GeminiInput extends ChatModelInput {
});
}

addAssistantMessage(text) {
this.addModelMessage(text);
}

getChatInput() {
return {
contents: this.messages
Expand Down
2 changes: 1 addition & 1 deletion IntelliNode/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "intellinode",
"version": "1.7.6",
"version": "1.7.7",
"description": "Integrate and evaluate various AI models, such as ChatGPT, Llama, Diffusion, Cohere, Gemini and Hugging Face.",
"main": "index.js",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion IntelliNode/test/integration/Chatbot.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ async function testGeminiChatCase2() {

// add inputs
geminiInput.addUserMessage("Write the first line of a story about a magic backpack.");
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.");
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.");
geminiInput.addUserMessage("Can you set it in a quiet village in 1600s France?");

const responses = await geminiBot.chat(geminiInput);
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Unified prompt, evaluation, and production integration to any large model

# Intelligent Node

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.
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.

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

// get the responses from the chatbot
// get chatGPT responses.
const chatbot = new Chatbot(OPENAI_API_KEY, 'openai');
const responses = await chatbot.chat(input);
```
Expand Down

0 comments on commit 630c9a8

Please sign in to comment.