mistral-core-workflow-a

Featured

Execute Mistral AI chat completions with streaming, multi-turn, and guardrails. Use when implementing chat interfaces, building conversational AI, or integrating Mistral for text generation. Trigger with phrases like "mistral chat", "mistral completion", "mistral streaming", "mistral conversation", "mistral guardrails".

AI & Automation 2,926 stars 433 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Mistral AI Core Workflow A: Chat Completions ## Overview Production chat completion patterns for Mistral AI: multi-turn conversations, streaming responses, JSON mode structured output, guardrails/moderation, and model selection. Uses the `@mistralai/mistralai` SDK. ## Prerequisites - Completed `mistral-install-auth` setup - `MISTRAL_API_KEY` environment variable set - Understanding of Mistral model tiers ## Instructions ### Step 1: Basic Chat Completion ```typescript import { Mistral } from '@mistralai/mistralai'; const client = new Mistral({ apiKey: process.env.MISTRAL_API_KEY }); async function chat(userMessage: string): Promise<string> { const response = await client.chat.complete({ model: 'mistral-small-latest', messages: [ { role: 'system', content: 'You are a helpful assistant.' }, { role: 'user', content: userMessage }, ], }); return response.choices?.[0]?.message?.content ?? ''; } ``` ### Step 2: Multi-Turn Conversation Manager ```typescript interface Message { role: 'system' | 'user' | 'assistant'; content: string; } class MistralConversation { private messages: Message[] = []; private client: Mistral; private model: string; constructor(systemPrompt: string, model = 'mistral-small-latest') { this.client = new Mistral({ apiKey: process.env.MISTRAL_API_KEY }); this.model = model; this.messages.push({ role: 'system', content: systemPrompt }); } async send(userMessage: string): Promise<string> { ...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
1 years ago
Last Updated
yesterday
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category