mistralai_dart 5.0.0 copy "mistralai_dart: ^5.0.0" to clipboard
mistralai_dart: ^5.0.0 copied to clipboard

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

5.0.0 #

Caution

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

Adds OCR-4 paragraph-level block extraction: set OcrRequest.includeBlocks: true to receive OcrPage.blocks, a sealed 13-variant OcrBlock union (text, title, list, table, image, equation, caption, code, and more), each with a bounding box and content in reading order. Breaking: OcrRequest.pages changes from List<int>? to the sealed OcrPages union, which also supports the new comma-separated string/range form (OcrPages.string('0,2-4')) alongside explicit lists (OcrPages.list([0, 1, 2])). Also fixes buildUrl producing a double slash when the base URL has a trailing slash and dropping (or collapsing repeated) base-URL query params, and adds a canonical package example so pub.dev's "Package has an example" check passes.

  • BREAKING FEAT: OCR-4 block extraction & pages union (#269). (ce96a1a3)
  • FIX: Avoid double slash and preserve base URL query params in buildUrl (#272). (2c403df3)

4.0.0 #

Caution

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

Syncs mistralai_dart with the latest Mistral OpenAPI spec (+46 paths, +123 schemas over the 2026-06-05 baseline), cross-checked field-by-field against the official mistralai/client-python SDK. Adds four new beta surfaces — Connectors (client.connectors: full CRUD + auth + tools + credentials), Observability traces/spans/logs (client.observability), RAG (client.rag: ingestion pipelines + search index), and new Workflow operations (bulk archive/unarchive, schedule pause/resume/trigger, execution logs + SSE) — plus many additive fields and enum values (ReasoningEffort.minimal/xhigh, expanded ModelCapabilities, ThinkContentPart.signature, and more). The breaking changes mirror server-side removals from the official Python SDK and affect a narrow surface: UsageInfo drops cached-token detail fields, OcrRequest drops its id, ChatChoice.message becomes nullable (with finishReason now non-nullable), and the deleted workers/whoami endpoint plus a few workflow fields are removed. See the Migration Guide for the full list and upgrade paths.

  • BREAKING FEAT: Connectors, RAG, observability & workflow ops (#263). (00db1583)

3.1.1 #

Migrates deprecated Mistral model identifiers to their current replacements (verified against Mistral's docs). The default model on the moderation/classification request classes (ModerationRequest, ChatModerationRequest, ClassificationRequest, ChatClassificationRequest) moves from the deprecated mistral-moderation-latest to mistral-moderation-2603 (Mistral Moderation 2) — so requests that omit model now target the current model — and the deprecated mistral-large-2411 doc examples move to the live mistral-large-latest alias. No schema changes.

  • FIX: Migrate deprecated model identifiers (#252). (5f0bf5d9)

3.1.0 #

Adds promptCacheKey to AgentCompletionRequest, ChatCompletionRequest, and FimCompletionRequest — tokens served from a cached prefix are billed at 10% of the standard input price. Re-introduces OCR confidence scores (OcrConfidenceScore, OcrPageConfidenceScores, the OcrConfidenceScoresGranularity enum, and the related fields on OcrRequest/OcrPage/OcrTable) following their return to the upstream spec, and adds the previously-missing metadata field on FimCompletionRequest for parity with the other completion requests. Refreshes the bundled OpenAPI spec to its 2026-05-09 snapshot. All changes are additive.

  • FEAT: Prompt cache key and OCR confidence scores (#222). (099093e1)
  • CHORE: Fix use_null_aware_elements lint flagged by Dart 3.12 (#232). (31ac5efc)

3.0.0 #

Caution

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

Syncs with the 2026-04-22 Mistral AI spec: 9 endpoints and 20 schemas were removed upstream with no additions. Breaking: the entire OCR confidence-score surface has been removed server-side, so OcrConfidenceScore, OcrPageConfidenceScores, OcrConfidenceScoresGranularity, and the related fields on OcrRequest, OcrPage, and OcrTable are gone from the client. The orphan WorkflowListResponse model is also deleted along with its retired GET /v1/workflows endpoint. This release also adds missing copyWith methods on ObservabilityError and ObservabilityErrorDetail.

  • BREAKING FEAT: Sync with 2026-04-22 spec; drop OCR confidence (#201). (f255b63b)
  • FIX: Add missing copyWith to ObservabilityError models (#202). (5d0ecfb5)

2.3.0 #

Adds support for OCR confidence scores with a new confidenceScoresGranularity request parameter (page or word) and per-page/per-word score response types. Also fills pre-existing spec gaps on OcrPage (tables, header, footer, hyperlinks) and OcrRequest (tableFormat, extractHeader, extractFooter, annotation formats).

  • FEAT: Update OpenAPI spec with OCR confidence scores (#188). (443d3318)
  • FEAT: Annotate llms.txt with token counts and tighten agent-facing docs (#181). (a1e82aca)

2.2.0 #

Adds two new beta API domains — Observability (41 endpoints for campaigns, datasets, judges, and chat completion monitoring) and Workflows (34 endpoints for workflow execution, scheduling, deployments, and tracing). Refreshes the OpenAPI spec with 75 new endpoints and 126 new schemas.

  • FEAT: Add Observability and Workflows beta APIs (#179). (1895a02b)

2.1.1 #

Adds an extra overflow field to SpeechRequest for passing additional properties to the Mistral speech API, and aligns the README layout with other packages.

  • FIX: Add extra field to SpeechRequest for additionalProperties (#170). (6f2c4d4c)
  • DOCS: Align README TIP position with other packages (#172). (a6562b99)

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.
9
likes
160
points
14.7k
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