mistral-hello-world

Featured

Create a minimal working Mistral AI chat completion example. Use when starting a new Mistral integration, testing your setup, or learning basic Mistral API patterns. Trigger with phrases like "mistral hello world", "mistral example", "mistral quick start", "simple mistral code", "mistral chat".

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 Hello World ## Overview Minimal working examples demonstrating Mistral AI chat completions, streaming, multi-turn conversation, and JSON mode. Uses the official `@mistralai/mistralai` TypeScript SDK and `mistralai` Python SDK. ## Prerequisites - Completed `mistral-install-auth` setup - Valid `MISTRAL_API_KEY` environment variable set - Node.js 18+ or Python 3.9+ ## Instructions ### Step 1: Basic Chat Completion **TypeScript (hello-mistral.ts)** ```typescript import { Mistral } from '@mistralai/mistralai'; const client = new Mistral({ apiKey: process.env.MISTRAL_API_KEY }); async function main() { const response = await client.chat.complete({ model: 'mistral-small-latest', messages: [ { role: 'user', content: 'Say "Hello, World!" in a creative way.' }, ], }); console.log(response.choices?.[0]?.message?.content); console.log('Tokens used:', response.usage); } main().catch(console.error); ``` **Python (hello_mistral.py)** ```python import os from mistralai import Mistral client = Mistral(api_key=os.environ["MISTRAL_API_KEY"]) response = client.chat.complete( model="mistral-small-latest", messages=[ {"role": "user", "content": "Say 'Hello, World!' in a creative way."} ], ) print(response.choices[0].message.content) print(f"Tokens: {response.usage}") ``` ### Step 2: Run the Example ```bash # TypeScript npx tsx hello-mistral.ts # Python python hello_mistral.py ``` ### Step 3: Streaming Response Streaming de...

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