googleai_dart 6.3.0 copy "googleai_dart: ^6.3.0" to clipboard
googleai_dart: ^6.3.0 copied to clipboard

Unofficial Dart client for Google AI Gemini and Vertex AI Gemini REST APIs plus Live API WebSocket sessions.

6.3.0 #

Syncs googleai_dart to the latest Gemini v1beta OpenAPI spec and adds an optional mediaId field to RetrievedContext. The Gemini API now returns a mediaId resource name (fileSearchStores/{store_id}/media/{blob_id}) on RetrievedContext chunks for multimodal file-search results, letting callers fetch the underlying blob from the FileSearchStore. The field is fully integrated into fromJson / toJson / copyWith / toString.

6.2.0 #

Adds support for the latest Gemini API surface. Introduces a new EmbedContentConfig schema that consolidates embedding request parameters — with new autoTruncate, documentOcr, and audioTrackExtraction fields — and deprecates the equivalent top-level taskType, title, and outputDimensionality fields on EmbedContentRequest. On the Interactions API, adds collaborativePlanning and visualization fields to DeepResearchAgentConfig, exposing the next-generation Gemini Deep Research human-in-the-loop planning and inline visualization capabilities.

  • FEAT: Update to latest Gemini OpenAPI spec (#197). (3d655ad9)

6.1.0 #

Adds a text-to-speech example for the new Gemini 3.1 Flash TTS preview model, demonstrating single-speaker synthesis, audio-tag control for inline pacing and tone, and multi-speaker dialogue. Also adds a README FAQ section for speech generation, fixes the image-generation snippet to use the ResponseModality enum, and refreshes the main OpenAPI spec metadata with no schema changes.

6.0.0 #

Caution

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

Aligns with the latest upstream OpenAPI specs, adding document and video response modalities, a new RetrievalTool variant (with VertexAISearchConfig) for Vertex AI Search, serviceTier support for flex/standard/priority tier selection, pageNumber on RetrievedContext, and channels/rate on audio content and delta types. Breaking: TextDelta.annotations has been removed and moved to a dedicated TextAnnotationDelta variant of InteractionDelta — streaming callers that handle annotation deltas must update their sealed-class pattern matching.

  • BREAKING FEAT: Update OpenAPI spec with new types and fields (#185). (ccc77d47)
  • FEAT: Annotate llms.txt with token counts and tighten agent-facing docs (#181). (a1e82aca)

5.1.0 #

Adds EmbeddingUsageMetadata with promptTokenCount and promptTokenDetails fields to EmbedContentResponse and BatchEmbedContentsResponse, enabling token usage tracking for embedding requests.

  • FEAT: Add EmbeddingUsageMetadata to embedding responses (#175). (f558312d)

5.0.1 #

Fixes the file search store upload URL (:upload:uploadToFileSearchStore) which caused a 404 on every call, and adds an optional force parameter to delete() and deleteDocument() for cascading deletes of documents and chunks.

  • FIX: Correct upload URL and add force param to file search stores (#169). (236a4ae8)
  • TEST: Add Gemma 4 integration test (#166). (ebf1904f)
  • CHORE: Update Veo model to veo-3.1-lite-generate-preview (#163). (f89bb3ae)

5.0.0 #

Caution

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

Updates the interactions OpenAPI spec with the new ContentDeltaData schema and FileSearchResult.customMetadata property, and makes 21 spec-required fields non-nullable across 15 interaction content types — aligned with the official Python SDK. Adds InteractionMediaResolution enum for type-safe resolution fields in image/video content and delta types. Also fixes list equality in ListPermissionsResponse to use deep comparison and replaces unnecessary lint ignores with proper fixes.

  • BREAKING FEAT: Update interactions spec and enforce required fields (#157). (741bb991)
  • REFACTOR: Remove unnecessary lint ignores (#154). (230f4929)
  • DOCS: Overhaul root README and add semver bullet to all packages (#151). (e6af33dd)

4.0.0 #

Caution

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

Major update aligning with the latest Google AI spec. Adds ToolType enum, ToolCall/ToolResponse models, full Google Maps support in the Interactions API, and restructures Annotation from a flat class to a sealed class with UrlCitation, FileCitation, and PlaceCitation subtypes. Strengthens weak types across models by replacing raw String?, List<String>?, and Map<String, dynamic>? fields with proper Dart enums and typed classes (ResponseModality, CodeExecution, UrlContext, MultiSpeakerVoiceConfig). Also adds ServiceTier enum for generation request prioritization, fixes Vertex AI base URL handling for the global location, and adds llms.txt ecosystem files. The Live API client is compatible with the new Gemini 3.1 Flash Live model for building conversational, multimodal agents with improved tool use and lower latency.

  • BREAKING FEAT: Align with latest Google AI spec (#131). (e4ab3166)
  • BREAKING FEAT: Strengthen weak types across models (#113). (c24d0897)
  • FEAT: Add ServiceTier enum and serviceTier to GenerateContentRequest (#139). (253eb8e4)
  • FIX: Update base URL for Vertex AI to handle global location (#146). (9d6cbdcb)
  • DOCS: Overhaul READMEs and add llms.txt ecosystem (#149). (98f11483)
  • TEST: Migrate Live API tests to gemini-3.1-flash-live-preview (#147). (1ed72c01)
  • TEST: Add TTS and STT integration tests (#112). (9c664da1)

3.6.0 #

Updated Interactions API with new content types (file search call, image config) and improved model fields. Also fixed interactions streaming by moving the stream flag from a query parameter to the request body, matching the official Python SDK behavior.

  • FEAT: Update interactions API models (#107). (21677923)
  • FIX: Move stream flag to request body for interactions streaming (#111). (c8e8f133)

3.5.0 #

Updated to the latest Google AI API spec with new model types (grounding metadata, model info, and image models) and added Gemini Embedding 2 support.

  • FEAT: Add Gemini Embedding 2 support (#95). (b7276ae8)
  • FEAT: Update spec and implement new model types (#93). (b898d414)
  • FIX: Rename Image class and ModelStage enum value to match spec (#96). (ea3fc432)

3.4.0 #

This release adds inline streaming error detection for improved reliability when handling streamed responses.

  • FEAT: Detect inline streaming errors (#91). (9f0eaf37)
  • DOCS: Improve READMEs with badges, sponsor section, and vertex_ai deprecation (#90). (5741f2f3)

3.3.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)

3.3.0 #

Added baseUrl and defaultHeaders parameters to withApiKey constructors for more flexible client initialization.

  • FEAT: Add baseUrl and defaultHeaders to withApiKey constructors (#57). (f0dd0caa)

3.2.0 #

Added withApiKey convenience constructor for simplified client initialization.

  • FEAT: Add withApiKey convenience constructors (#56). (b06e3df3)
  • 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)

3.1.0 #

Added thoughtSignature support for FunctionCallPart and ThoughtPart, pre-release Gemini 3.1 migration and documentation fixes, and various architecture alignments.

  • FEAT: Pre-release Gemini 3.1 migration and doc fixes (#47). (8fcfbd84)
  • FEAT: Add thoughtSignature support to FunctionCallPart and ThoughtPart (#39). (cd2f5bdc)
  • FIX: Fix linter issues. (ad1e1f94)
  • REFACTOR: Align client package architecture across SDK packages (#37). (cf741ee1)
  • REFACTOR: Align API surface across all SDK packages (#36). (ed969cc7)
  • REFACTOR: Extract streaming helpers to StreamingResource mixin (#2). (0b6f0ed9)
  • DOCS: Add image generation documentation and example (#25). (21602051)
  • DOCS: Add comprehensive examples (#14). (b3bade72)
  • DOCS: Refactors repository URLs to new location. (76835268)

3.0.0 #

Caution

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

  • FEAT: add convenience helpers for improved DX (#924). (634b4f97)
  • FEAT: Update default models to Gemini 3 family (#922). (62bca9da)
  • FEAT: Auto-populate batch.model from method parameter (#921). (abfeded8)
  • BREAKING FEAT: replace List

2.1.0 #

  • FEAT: Add Gemini Live API (WebSocket) support (#920). (4beb01dd)
  • FEAT: Add missing model properties from OpenAPI spec (#916). (fc0e2f8a)
  • DOCS: Add documentation for grounding tools (#917). (b5a529fe)

2.0.0 #

Caution

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

  • BREAKING FEAT: Remove deprecated schema fields (#848). (e6d07ec4)
  • BREAKING FEAT: Remove deprecated Chunks and query APIs (#847). (9cae76d5)
  • BREAKING FEAT: Remove deprecated RagStores resource (#846). (1ab553f1)
  • FEAT: Add InteractionsResource and client integration (#905). (af6b13ea)
  • FEAT: Add Interactions API tool types (#904). (2258cfa1)
  • FEAT: Add Interactions API events and deltas (#903). (826d3f64)
  • FEAT: Add Interactions API content types (#902). (b8c61743)
  • FEAT: Add Interactions API core models (#901). (65f5db17)
  • FEAT: Update existing models with new properties (#856). (dd3893e0)
  • FEAT: Add RetrievalConfig to ToolConfig (#855). (5e11aa70)
  • FEAT: Add MediaResolution to Part (#854). (df76f8c5)
  • FEAT: Add GoogleMaps tool (#853). (54814614)
  • FEAT: Add McpServers tool (#852). (97970687)
  • FEAT: Add FileSearch tool (#851). (a00895b1)
  • FEAT: Add grounding models (#850). (bb1a6228)
  • FEAT: Add FileSearchStores resource (#849). (acb63d72)
  • FEAT: Add ThinkingConfig support to GenerationConfig (#817). (36de62a9)
  • FIX: Complete alignment with target implementation (#884). (60476e8d)
  • DOCS: Add Interactions API docs and example (#897). (f4a04677)

1.1.0 #

  • FEAT: Make googleai_dart fully WASM compatible (#808). (07e597f3)
  • REFACTOR: Fix pub format warnings (#809). (640cdefb)

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, unified resource-based API, and full Gemini API coverage. Includes new Files, Batches, Caching, Corpora/RAG, RAG Stores, Dynamic Content, Permissions, Tuned Models, and Prediction (Veo) support.

What's new #

  • Unified client for both:
    • Google AI Gemini Developer API
    • Vertex AI Gemini API
  • Complete API coverage: 78 endpoints.
    • Files API: upload, list, get, delete, download.
    • Generated Files API: list, get, getOperation (video outputs).
    • Cached Contents: full CRUD.
    • Batch operations: batchGenerateContent, batchEmbedContents, asyncBatchEmbedContent with LRO polling.
    • Corpora & RAG: corpus CRUD (Google AI); documents/chunks/query, metadata filters, batch chunk ops (Vertex AI only).
    • RAG Stores: documents list/create/get/delete/query + operations.
    • Dynamic Content: generate/stream content with dynamic model IDs.
    • Permissions: create/list/get/update/delete/transferOwnership for eligible resources.
    • Tuned Models: list, get, listOperations, generation APIs.
    • Prediction (Veo): predict, predictLongRunning, operation polling, RAI filtering.
  • Architecture:
    • Interceptor chain (Auth → Logging → Error).
    • Authentication: API key, Bearer token, custom OAuth via AuthProvider.
    • Retry with exponential backoff + jitter.
    • Abortable requests via abortTrigger (streaming and non-streaming).
    • SSE streaming parser.
    • Central GoogleAIConfig (timeouts, retry policy, log level, baseUrl).
  • Testing:
    • 560+ tests covering all endpoints, error branches, streaming/abort flows.

Breaking Changes #

  • Resource-based API: Methods reorganized under strongly-typed resources:
    • client.models.* (generation, streaming, embeddings, tokens, prediction)
    • client.tunedModels.*
    • client.files.*, client.generatedFiles.*
    • client.cachedContents.*
    • client.batches.*
    • client.corpora.*
    • client.ragStores.*
  • Parameter rename: modelIdmodel.
  • Configuration: New GoogleAIConfig with AuthProvider pattern (API key / bearer / custom OAuth).
  • Exceptions: Replaced ad-hoc errors with a typed hierarchy:
    • ApiException, ValidationException, RateLimitException, TimeoutException, AbortedException.
  • Dependencies: Removed fetch_client; now minimal (http, logging).

See MIGRATION.md for step-by-step examples and mapping tables.

0.1.3 #

0.1.2 #

0.1.1 #

  • 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.1.0+3 #

  • REFACTOR: Upgrade api clients generator version (#610). (0c8750e8)

0.1.0+2 #

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

0.1.0+1 #

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

0.1.0 #

0.0.4 #

  • FEAT: Support generateContent for tuned model in googleai_dart client (#358). (b4641a09)
  • FEAT: Support output dimensionality in Google AI Embeddings (#373). (6dcb27d8)
  • FEAT: Support updating API key in Google AI client (#357). (b9b808e7)
  • FIX: Have the == implementation use Object instead of dynamic (#334). (89f7b0b9)

0.0.3 #

  • FEAT: Add streaming support to googleai_dart client (#299). (2cbd538a)
  • FEAT: Update meta and test dependencies (#331). (912370ee)
  • DOCS: Update pubspecs. (d23ed89a)

0.0.2+2 #

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 Google AI API (#267). (99083cd2)

0.0.1-dev.1 #

  • Bootstrap project.
26
likes
70
points
4.66k
downloads

Documentation

Documentation

Publisher

verified publisherdavidmiguel.com

Weekly Downloads

Unofficial Dart client for Google AI Gemini and Vertex AI Gemini REST APIs plus Live API WebSocket sessions.

Homepage
Repository (GitHub)
View/report issues

Topics

#nlp #gen-ai #llms #googleai #gemini

Funding

Consider supporting this project:

github.com

License

MIT (license)

Dependencies

collection, http, logging, meta, web_socket

More

Packages that depend on googleai_dart