mistral-sdk-patterns
Apply production-ready Mistral AI SDK patterns for TypeScript and Python.\nUse when implementing Mistral integrations, refactoring SDK usage,\nor establishing team coding standards for Mistral AI.\nTrigger with phrases like \
Installation
Pick a client and clone the repository into its skills directory.
Installation
About this skill
Apply production-ready Mistral AI SDK patterns for TypeScript and Python.\nUse when implementing Mistral integrations, refactoring SDK usage,\nor establishing team coding standards for Mistral AI.\nTrigger with phrases like \
How to use
Zainstaluj wymagane pakiety: dla TypeScript
@mistralai/mistralai, dla Pythonmistralai. Upewnij się, że masz ustawioną zmienną środowiskowąMISTRAL_API_KEYz Twoim kluczem API Mistral.Wyzwól skill w swoim edytorze kodu jedną z fraz: "mistral SDK patterns", "mistral best practices", "mistral code patterns" lub "idiomatic mistral".
Skill zaproponuje implementację singleton client — funkcję, która inicjalizuje i cachuje instancję Mistral z timeoutem 30 sekund i maksymalnie 3 próbami ponowienia. Dla TypeScript użyj ESM (
@mistralai/mistralai), dla Python zarówno sync jak i async API.Zastosuj wzorzec singleton w swoim kodzie, aby uniknąć wielokrotnego tworzenia klientów. Skill zawiera również reset client dla testów.
Dla zaawansowanych scenariuszy skill dostarcza wzorce do structured output, streamingu, function calling i batch embeddings — wszystkie z wbudowaną obsługą błędów.
Przejrzyj kod wygenerowany przez skill i dostosuj timeout oraz liczbę prób ponowienia do potrzeb Twojego projektu.