Skip to content

IntelliNode v0.0.10

Compare
Choose a tag to compare
@Barqawiz Barqawiz released this 30 Apr 21:54
· 391 commits to main since this release
e3d06e3

New Features 🌟

  • Embeddings: IntelliNode now supports multi-language embeddings from multiple providers, OpenAI and Cohere. This feature enables developers to extract contextualized representations of text.
  • Semantic Search: Add a new semantic search function to search arrays of text and match the closest meaning.

Changes 🔧

  • Update the default cohere model.
  • Add more samples.

Code Examples 💻

Semantic Search
example of search item and searchable list:

const pivotItem = 'Hello from OpenAI!';
const searchArray = ['Greetings from OpenAI!', 'Bonjour de OpenAI!', 'Hola desde OpenAI!'];
const numberOfMatches =2;

semantic search functionality:

const { SemanticSearch } = require('intellinode');

// prepare the search object with 'openai' or 'cohere' provider
// the apiKey generated from the provider
const search = new SemanticSearch(apiKey, provider);

// execute the match function, return top items with similarity scores
const results = await search.getTopMatches(pivotItem, searchArray, numberOfMatches);

Embeddings

const { RemoteEmbedModel, EmbedInput } = require('intellinode');

const embedModel = new RemoteEmbedModel(openaiApiKey);

const results = await embedModel.getEmbeddings(new EmbedInput({
    texts: ['Hello from OpenAI!', '您好,来自 OpenAI!'],
    model: 'text-embedding-ada-002',
}));

Install

npm i intellinode