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 • 970 B
JavaScript
import { py } from './bridge/multimind-bridge.js';
export async function generateWithAgent(prompt, config = {}) {
const { model = "mistral", temperature = 0.7, maxTokens = 1000 } = config;
try {
await py `agent = MultiMindAgent(${model}, temperature=${temperature}, max_tokens=${maxTokens})`;
const result = await py `agent.generate(${prompt})`;
return result;
}
catch (error) {
console.error('Error generating with agent:', error);
throw error;
}
}
export async function createAgent(config = {}) {
const { model = "mistral", temperature = 0.7, maxTokens = 1000 } = config;
try {
await py `agent = MultiMindAgent(${model}, temperature=${temperature}, max_tokens=${maxTokens})`;
return { success: true, message: 'Agent created successfully' };
}
catch (error) {
console.error('Error creating agent:', error);
throw error;
}
}
//# sourceMappingURL=agent.js.map