mistralai_dart 2.1.0
mistralai_dart: ^2.1.0 copied to clipboard
Dart client for the Mistral AI API - chat, embeddings, fine-tuning, agents, and more.
2.1.0 #
Adds ToolFileContentPart and ToolReferenceContentPart sealed variants to ContentPart for built-in tool output content (code interpreter files, web search references). Also adds unknown fallback values to ReasoningEffort and SpeechOutputFormat enums for forward compatibility.
2.0.0 #
Caution
This release has breaking changes. See the Migration Guide for upgrade instructions.
Major update to the latest Mistral AI spec. Renames ModerationLLMV1Action to ModerationLLMAction, adds Moderation V2 with 11 categories, guardrails on chat requests, CustomConnectorTool, 5 new ContentPart variants, and UnknownContentPart for forward compatibility. Replaces untyped Object fields with sealed union types (MessageContent, EmbedInput) for type safety across all ChatMessage variants. Adds text-to-speech synthesis with streaming support, voice management with CRUD operations, reasoningEffort parameter, and llms.txt ecosystem files.
- BREAKING FEAT: Update to latest Mistral AI OpenAPI spec (#130). (ac07542b)
- BREAKING REFACTOR: Replace Object fields with sealed union types (#119). (014cc1dc)
- BREAKING FEAT: Add TTS, voice management, and reasoning effort support (#140). (8c99bd48)
- REFACTOR: Standardize equality helpers location across packages (#123). (34086102)
- DOCS: Overhaul READMEs and add llms.txt ecosystem (#149). (98f11483)
- TEST: Add TTS and voice integration tests (#148). (f0ec0879)
- CHORE: Clean up documentation.json configs and lift fineTuningModels exclusion (#117). (fdd03bf2)
1.3.0 #
This release adds inline streaming error detection and updates the API spec to the latest version with new models and capabilities including agent aliases, guardrail configuration, tool call confirmations, and batch request types.
- FEAT: Detect inline streaming errors (#91). (9f0eaf37)
- FEAT: Update OpenAPI spec with new models (
AgentAliasResponse,BatchRequest,GuardrailConfig,ToolCallConfirmation,ToolConfiguration), add agent alias CRUD methods, and update existing models with new fields (#89). (4aa455e7) - DOCS: Improve READMEs with badges, sponsor section, and vertex_ai deprecation (#90). (5741f2f3)
1.2.1 #
1.2.0 #
1.1.0 #
Added withApiKey convenience constructor and replaced Object? stop with a type-safe StopSequence sealed class for improved API safety.
1.0.0 #
Caution
This release has breaking changes. See the Migration Guide for upgrade instructions.
TL;DR: Complete reimplementation with a new architecture, minimal dependencies, resource-based API, and improved developer experience. Hand-crafted models (no code generation), interceptor-driven architecture, comprehensive error handling, and full Mistral AI API coverage including stable and beta endpoints.
What's new #
- Resource-based API organization:
client.chat— Chat completions (streaming, tool calling, multimodal, JSON mode)client.embeddings— Text embeddings for semantic search and clusteringclient.models— Model listing and retrievalclient.fim— Fill-in-the-Middle code completions (Codestral)client.files— File upload and managementclient.fineTuning— Fine-tuning jobs and model managementclient.batch— Asynchronous large-scale batch processingclient.moderations— Content moderation for safetyclient.classifications— Text classification (spam, topic, sentiment)client.ocr— OCR for documents and imagesclient.audio— Speech-to-text transcription with streamingclient.agents— Pre-configured AI assistants (beta)client.conversations— Stateful multi-turn conversations (beta)client.libraries— Document storage and retrieval for RAG (beta)
- Architecture:
- Interceptor chain (Auth → Logging → Error → Transport with Retry wrapper).
- Authentication: API key or custom via
AuthProviderinterface. - Retry with exponential backoff + jitter (only for idempotent methods on 429, 5xx, timeouts).
- Abortable requests via
abortTriggerparameter. - SSE streaming parser for real-time responses with
[DONE]marker handling. - Central
MistralConfig(timeouts, retry policy, log level, baseUrl, auth).
- Hand-crafted models:
- No code generation dependencies (no freezed, json_serializable).
- Minimal runtime dependencies (
http,loggingonly). - Immutable models with
copyWithusing sentinel pattern for nullable fields. - Full type safety with sealed exception hierarchy.
- Sealed classes for polymorphic types (
ChatMessage,ContentPart,ToolChoice,ResponseFormat,Tool,OcrDocument).
- Improved DX:
- Named constructors for common patterns (e.g.,
ChatMessage.user(),ChatMessage.system(),Tool.function(),Tool.webSearch()). - Explicit streaming methods (
createStream()vscreate()). - Extension methods for convenient response access (
response.text,response.toolCalls,response.hasToolCalls). - Rich logging with field redaction for sensitive data.
- Pagination utilities (
Paginator) and job polling helpers (FineTuningJobPoller,BatchJobPoller).
- Named constructors for common patterns (e.g.,
- Full API coverage:
- Chat completions with tool calling, multimodal inputs, and JSON schema validation.
- Fill-in-the-Middle (FIM) code completions with streaming.
- Text embeddings with dimension control and quantization options.
- File management (upload, download, signed URLs).
- Fine-tuning with hyperparameter control and W&B integration.
- Batch processing for large-scale async operations.
- Content moderation and text classification.
- OCR for PDFs and images with markdown output.
- Audio transcription with word-level timestamps.
- Agents with built-in tools (web search, code interpreter, image generation).
- Stateful conversations with context management.
- Document libraries for RAG workflows.
See MIGRATION.md for step-by-step examples and mapping tables.
Commits #
- BREAKING FEAT: Complete v1.0.0 reimplementation (#8). (e18581e5)
- FEAT: Update README and add classification/moderation examples (#15). (88b2064c)
- FIX: Pre-release documentation and code fixes (#44). (93c78871)
- REFACTOR: Align client package architecture across SDK packages (#37). (cf741ee1)
- REFACTOR: Align API surface across all SDK packages (#36). (ed969cc7)
- DOCS: Refactors repository URLs to new location. (76835268)
0.1.1 #
0.1.0 #
Caution
This release has breaking changes. See the Migration Guide for upgrade instructions.
0.0.4 #
0.0.3+4 #
0.0.3 #
0.0.2 #
- Update a dependency to the latest release.
0.0.1-dev.1 #
- Bootstrap project.