29 lines
769 B
JavaScript
29 lines
769 B
JavaScript
const Bot = require('./bot');
|
|
|
|
const faqs = [
|
|
{
|
|
id: '1',
|
|
question: 'What is ChromaDB?',
|
|
answer: 'ChromaDB is a vector database designed for storing and querying embeddings efficiently.',
|
|
},
|
|
{
|
|
id: '2',
|
|
question: 'How do I use MCP-tool?',
|
|
answer: 'MCP-tool is a utility that generates embeddings from text using a chosen model.',
|
|
},
|
|
{
|
|
id: '3',
|
|
question: 'Can I delete a document from the vector store?',
|
|
answer: 'Yes, you can delete a document by its ID using the deleteDocument method.',
|
|
},
|
|
];
|
|
|
|
(async () => {
|
|
const bot = new Bot();
|
|
await bot.init();
|
|
await bot.indexFAQs(faqs);
|
|
|
|
const userQuestion = 'Explain ChromaDB';
|
|
const response = await bot.answer(userQuestion);
|
|
console.log('Answer:\n', response);
|
|
})(); |