Skip to content

IntelliNode v0.0.13

Compare
Choose a tag to compare
@Barqawiz Barqawiz released this 01 May 21:32
· 375 commits to main since this release

v0.0.13

New Features 🌟

  • Text Analyzer Function: introduce the Text Analyzer function, which supports summarization and sentiment analysis using multiple AI models (openai or cohere).
  • Hugging Face Wrapper 🤗: support Hugging Face inference! With our Hugging Face Wrapper, you can now call Hugging Face models using shorter code than ever. Experience the shortest way to integrate Hugging Face models into your applications.

Changes 🔧

  • Chatbot: Update chatGPT to support extra optional parameters for flexible implementation.

Code Examples 💻

Text Analyzer

const { TextAnalyzer, SupportedLangModels } =  require('intellinode');
// provider values: SupportedLangModels.openai OR SupportedLangModels.cohere
async function summarize(text, apiKey, provider) {
  const analyzer = new TextAnalyzer(apiKey, provider);
  return await analyzer.summarize(text);
}

Hugging Face
Common import for any hugging face model:

const { HuggingWrapper } =  require('intellinode');
const huggingWrapper = new HuggingWrapper(process.env.HUGGING_API_KEY);

Summary using facebook large-cnn:

const modelId = 'facebook/bart-large-cnn';
const result = await huggingWrapper.generateText(modelId, inputData);

Image classification using vit-base model

const imageData = require('fs').readFileSync(imagePath);
const result = await huggingWrapper.processImage('google/vit-base-patch16-224', imageData);

ChatGPT with extra options

const { Chatbot, ChatGPTInput } = require('intellinode');
// define the model response using the system
const input = new ChatGPTInput('You are a helpful assistant.', { model: 'gpt-4'} );
input.addUserMessage('What is the distance between the Earth and the Moon?');
const responses = await chatbot.chat(input);

Install

npm i intellinode