Skip to content

IntelliNode v1.7.9

Compare
Choose a tag to compare
@Barqawiz Barqawiz released this 21 Jan 22:30
· 45 commits to main since this release
525ada8

New Changes 🌟

  • Add google gemini embedding function.
  • Update the evaluator to include the latest chatbot models (Gemini and Mistral AI).

Using the New Features 💻

LLM evaluator example:

  1. Imports and chatbot config
const { LLMEvaluation, SupportedChatModels } = require('intellinode')
// prepare the configurations
const openaiChat = { apiKey: process.env.OPENAI_API_KEY, provider: SupportedChatModels.OPENAI, type: 'chat', model: 'gpt-3.5-turbo' };
const geminiChat = { apiKey: process.env.GEMINI_API_KEY, provider: SupportedChatModels.GEMINI, type: 'chat', model: 'gemini' };
const mistralChat = { apiKey: process.env.MISTRAL_API_KEY, provider: SupportedChatModels.MISTRAL, type: 'chat', model: 'mistral-medium' };

const providerSets = [openaiChat, geminiChat, mistralChat];
  1. Prepare the testing data
// pivot string to test the models
const inputString = "Explain the process of photosynthesis in simple terms.";

// optimal answers - adding more answers will make the evaluation more robust
const targetAnswers = ["Photosynthesis is the process where green plants use sunlight to turn carbon dioxide and water into glucose and oxygen. The glucose provides food for the plant, and the oxygen gets released back into the air.",
    "Photosynthesis is how plants make their own food. They take in water and carbon dioxide, use the energy from sunlight to transform them into glucose (their food) and oxygen, which they release into the air."];
  1. Call the evaluator and print the results
const results = await llmEvaluation.compareModels(inputString, targetAnswers, providerSets);
console.log('Model Evaluation Results:', results);

Contributors