UNPKG

multimind-sdk

Version:

This SDK gives JavaScript/TypeScript developers full access to advanced AI features like agent orchestration, RAG, and fine-tuning — without needing to manage backend code.

25 lines 963 B
import { py } from './bridge/multimind-bridge.js'; export async function queryRAG(prompt, config) { const { indexPath, topK = 5, similarityThreshold = 0.7 } = config; try { await py `rag = RAGEngine(index_path=${indexPath}, top_k=${topK}, similarity_threshold=${similarityThreshold})`; const result = await py `rag.query(${prompt})`; return result; } catch (error) { console.error('Error querying RAG:', error); throw error; } } export async function createRAGEngine(config) { const { indexPath, topK = 5, similarityThreshold = 0.7 } = config; try { await py `rag = RAGEngine(index_path=${indexPath}, top_k=${topK}, similarity_threshold=${similarityThreshold})`; return { success: true, message: 'RAG Engine created successfully' }; } catch (error) { console.error('Error creating RAG Engine:', error); throw error; } } //# sourceMappingURL=rag.js.map