import { Mistral } from '@mistralai/mistralai'; import dotenv from 'dotenv'; dotenv.config(); const client = new Mistral({ apiKey: process.env.9Qu2FOvCaQ0uvbvBorFOPMGrxQdXEIZD, }); const messages = [ {"role": "user", "content": "Hello!"} ]; const completionArgs = { temperature: 0.7, maxTokens: 2048, topP: 1 }; const tools = []; async function main() { const response = await client.beta.conversations.start({ inputs: messages, model: 'mistral-medium-latest', instructions: ``, ...completionArgs, tools }); console.log(response); } main();
top of page
bottom of page