Skip to content

IntelliNode v1.4.2

Compare
Choose a tag to compare
@intelligentnode intelligentnode released this 10 Sep 18:45
· 175 commits to main since this release
8c9ea21

New Changes 🌟

  • Add a chat context function to manage the relevant messages for chatbots.
  • Update the module to support next.js integration.

Code Examples 💻

  • Check example of next.js integration with a modern chatbot interface.

  • Try the below Code to manage the chatbot history strategy.

const { ChatContext } = require('intellinode');
const context = new ChatContext(apiKey);

# Parameters
const userMessage = "Hello";
const historyMessages = ["Good morning", "Dinner time", "How can I help you?", "Hello"];
const n = 3;

# Execute the filter 
const resultContext = await context.getStringContext(userMessage, historyMessages, n);

This code manages the chatbot window size limitation by returning the relevant messages for the user input. Define a window size (n), and the function will filter the last two messages in addition to the relevant ones from the history fitting the window size.

Full chat context sample available here

Contributors 👏

  • @Eytyy fixed next.js integration.
  • @Barqawiz added the chat context functionality.