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.
47 lines • 1.57 kB
JavaScript
import MultiMindSDK from '../index.js';
async function main() {
const sdk = new MultiMindSDK();
try {
console.log('Initializing MultiMind SDK...');
await sdk.initialize();
console.log('Generating response with agent...');
const output = await sdk.generateWithAgent("What is MultiMind SDK?", {
model: "mistral",
temperature: 0.7,
maxTokens: 500
});
console.log("Agent Output:", output);
// Example of using RAG
console.log('\n--- RAG Example ---');
try {
const ragOutput = await sdk.queryRAG("What is the latest research on transformers?", {
indexPath: "./data/index",
topK: 3,
similarityThreshold: 0.8
});
console.log("RAG Output:", ragOutput);
}
catch (error) {
console.log("RAG example skipped (index path may not exist):", error.message);
}
// Example of listing available models
console.log('\n--- Available Models ---');
try {
const models = await sdk.listAvailableModels();
console.log("Available models:", models);
}
catch (error) {
console.log("Could not list models:", error.message);
}
}
catch (error) {
console.error('Error:', error);
}
finally {
console.log('Closing MultiMind SDK...');
await sdk.close();
}
}
// Run the example
main().catch(console.error);
//# sourceMappingURL=run-agent.js.map