mistralai_dart 2.1.0 copy "mistralai_dart: ^2.1.0" to clipboard
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.

  • FEAT: Add tool content parts and enum fallbacks (#158). (248a7051)
  • DOCS: Overhaul root README and add semver bullet to all packages (#151). (e6af33dd)

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 #

Internal improvements to build tooling and package publishing configuration.

  • REFACTOR: Migrate API skills to the shared api-toolkit CLI (#74). (923cc83e)
  • CHORE: Add .pubignore to exclude .agents/ and specs/ from publishing (#78). (0ff199bf)

1.2.0 #

Added baseUrl and defaultHeaders parameters to withApiKey constructors and unified equality helpers across packages.

  • FEAT: Add baseUrl and defaultHeaders to withApiKey constructors (#57). (f0dd0caa)
  • REFACTOR: Unify equality_helpers.dart across packages (#67). (ec2897f8)

1.1.0 #

Added withApiKey convenience constructor and replaced Object? stop with a type-safe StopSequence sealed class for improved API safety.

  • FEAT: Add withApiKey convenience constructors (#56). (b06e3df3)
  • REFACTOR: Replace Object? stop with StopSequence sealed class (#53). (b6313f54)
  • CHORE: Bump googleapis from 15.0.0 to 16.0.0 and Dart SDK to 3.9.0 (#52). (eae130b7)
  • CI: Add GitHub Actions test workflow (#50). (6c5f079a)

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 clustering
    • client.models — Model listing and retrieval
    • client.fim — Fill-in-the-Middle code completions (Codestral)
    • client.files — File upload and management
    • client.fineTuning — Fine-tuning jobs and model management
    • client.batch — Asynchronous large-scale batch processing
    • client.moderations — Content moderation for safety
    • client.classifications — Text classification (spam, topic, sentiment)
    • client.ocr — OCR for documents and images
    • client.audio — Speech-to-text transcription with streaming
    • client.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 AuthProvider interface.
    • Retry with exponential backoff + jitter (only for idempotent methods on 429, 5xx, timeouts).
    • Abortable requests via abortTrigger parameter.
    • 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, logging only).
    • Immutable models with copyWith using 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() vs create()).
    • 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).
  • 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+1 #

0.1.1 #

  • FEAT: Align Chat API with latest Mistral spec (#887). (b5a12301)
  • FEAT: Align embeddings API with latest Mistral spec (#886). (769edc49)

0.1.0+1 #

0.1.0 #

Caution

This release has breaking changes. See the Migration Guide for upgrade instructions.

  • FIX: Add missing usage field to ChatCompletionStreamResponse in mistralai_dart (#795). (4da75561)
  • FIX: Handle optional space after colon in SSE parser in mistralai_dart (#791). (cefb1d2f)
  • FEAT: Upgrade to http v1.5.0 (#785). (f7c87790)
  • BREAKING BUILD: Require Dart >=3.8.0 (#792). (b887f5c6)

0.0.6 #

0.0.5 #

0.0.4 #

  • FEAT: Update dependencies (requires Dart 3.6.0) (#709). (9e3467f7)
  • REFACTOR: Remove fetch_client dependency in favor of http v1.3.0 (#659). (0e0a685c)
  • FIX: Fix linter issues (#656). (88a79c65)

0.0.3+4 #

  • REFACTOR: Add new lint rules and fix issues (#621). (60b10e00)
  • REFACTOR: Upgrade api clients generator version (#610). (0c8750e8)

0.0.3+3 #

  • REFACTOR: Migrate conditional imports to js_interop (#453). (a6a78cfe)

0.0.3+2 #

  • FIX: Fix deserialization of sealed classes (#435). (7b9cf223)

0.0.3+1 #

  • FIX: Have the == implementation use Object instead of dynamic (#334). (89f7b0b9)

0.0.3 #

0.0.2+3 #

0.0.2+2 #

  • REFACTOR: Update safe_mode and max temperature in Mistral chat (#300). (1a4ccd1e)

0.0.2+1 #

  • REFACTOR: Make all LLM options fields nullable and add copyWith (#284). (57eceb9b)

0.0.2 #

  • Update a dependency to the latest release.

0.0.1+1 #

  • FIX: Fetch web requests with big payloads dropping connection (#273). (425889dc)

0.0.1 #

  • FEAT: Implement Dart client for Mistral AI API (#261). (f4954c59)

0.0.1-dev.1 #

  • Bootstrap project.
8
likes
150
points
2.71k
downloads

Documentation

API reference

Publisher

verified publisherlangchaindart.dev

Weekly Downloads

Dart client for the Mistral AI API - chat, embeddings, fine-tuning, agents, and more.

Homepage
Repository (GitHub)
View/report issues

Topics

#nlp #gen-ai #llms #mistral

License

MIT (license)

Dependencies

http, logging, meta

More

Packages that depend on mistralai_dart