PackageTrack
Sign in Get early access

google_generative_ai

The Google AI Dart SDK enables developers to use Google's state-of-the-art generative AI models (like Gemini).

0.4.7 91K downloads/mo #1166 most downloaded on pub.dev google-gemini/generative-ai-dart

What this package is like to depend on

Last release 1 years ago

17 Apr 2025

Ships unpredictably

gaps range from 8 days to 7 months

Nearly every release is documented

notes for 17 of 17 stable releases

Nothing withdrawn

no release was ever pulled

3 years old

18 releases · first in 2024

0 releases in the last 12 months

see the full history below

Release timeline

18 releases · Feb 2024 to Apr 2025
2025 2026
Release Pre-release

Releases

latest 18
  1. 0.4.7 17 Apr 2025
    Release notes
    • Update the README.md to indicate that this package is deprecated; using the Firebase SDK is the preferred path forward.
    Open source →
  2. 0.4.6 04 Sep 2024
    Release notes

    We do not expect format exceptions to occur unless the server API is
    changing. Change from a plain FormatException to a specific exception
    which indicates the two possible resolution strategies - upgrade if not
    already on the latest SDK, or file an issue.

    Open source →
    Release notes
    • Throw a more relevant exception for server error HTTP responses.
    Open source →
  3. 0.4.5 16 Aug 2024
    Release notes
    • Add support for model side Code Execution. Enable code execution by
      configuring Tools with a codeExecution argument.
    • Use a default role 'model' when a chat response comes back with no role.
    Open source →
    Release notes
    • Add support for model side Code Execution. Enable code execution by configuring Tools with a codeExecution argument.
    • Use a default role 'model' when a chat response comes back with no role.
    Open source →
  4. 0.4.4 01 Aug 2024
    Release notes

    Fixes #184

    The vertex backend uses a similar data model, but names the field
    citations instead of citationSources. Read either field, whichever
    exists, and parse it otherwise consistently.

    Open source →
    Release notes
    • Allow the Vertex format for citation metadata - read either citationSources or citations keys, whichever exists. Fixes a FormatException when parsing vertex results with citations.
    Open source →
  5. 0.4.3 05 Jun 2024
    Release notes

    Maintains the internal details of using the client, but offers a general
    escape hatch for any unary request by exposing Task.

    Add a makeRequest utility method in an extension, and update the
    existing unary requests to use it.

    Open source →
    Release notes
    • Internal changes to enable reuse in the Vertex SDK. No user visible changes.
    Open source →
  6. 0.4.2 30 May 2024
    Release notes
    • Add support for GenerationConfig.responseSchema for constraining JSON mime
      type output formats.
    • Require Dart 3.1.
    Open source →
    Release notes
    • Add support for GenerationConfig.responseSchema for constraining JSON mime type output formats.
    • Require Dart 3.1.
    Open source →
  7. 0.4.1 23 May 2024
    Release notes
    • Concatenate multiple TextPart into the text String in case the model
      replies with more than one part.
    • Fix handling of format argument to Schema.number and Schema.integer.
    • Export UsageMetadata.
    • Include the full GenerateContentRequest (previously omitted
      safetySettings, generationConfig, tools, toolConfig, and
      systemInstruction) in countTokens requests. This aligns the token count
      with the token count the backend will see in practice for a
      generateContent request.
    • Add a text getter on Candidate to make it easer to retrieve the text from
      candidates other than the first in a response.
    Open source →
    Release notes
    • Concatenate multiple TextPart into the text String in case the model replies with more than one part.
    • Fix handling of format argument to Schema.number and Schema.integer.
    • Export UsageMetadata.
    • Include the full GenerateContentRequest (previously omitted safetySettings, generationConfig, tools, toolConfig, and systemInstruction) in countTokens requests. This aligns the token count with the token count the backend will see in practice for a generateContent request.
    • Add a text getter on Candidate to make it easer to retrieve the text from candidates other than the first in a response.
    Open source →
  8. 0.4.0 10 May 2024
    Release notes
    • Add support for parsing Vertex AI specific fields in CountTokensResponse.
    • Add named constructors on Schema for each value type.
    • Add GenerationConfig.responseMimeType which supports setting
      'application/json' to force the model to reply with JSON parseable output.
    • Add outputDimensionality argument support for embedContent and
      batchEmbedContent.
    • Add Content.functionResponses utility to reply to multiple function calls in
      parallel.
    • Breaking The Part class is no longer sealed. Exhaustive switches over
      a Part instance will need to add a wildcard case.
    Open source →
    Release notes
    • Add support for parsing Vertex AI specific fields in CountTokensResponse.
    • Add named constructors on Schema for each value type.
    • Add GenerationConfig.responseMimeType which supports setting 'application/json' to force the model to reply with JSON parseable output.
    • Add outputDimensionality argument support for embedContent and batchEmbedContent.
    • Add Content.functionResponses utility to reply to multiple function calls in parallel.
    • Breaking The Part class is no longer sealed. Exhaustive switches over a Part instance will need to add a wildcard case.
    Open source →
  9. 0.3.3 07 May 2024
    Release notes

    Add usageMetadata to GenerateContentResponse (#143)

    Add `UsageMetadata` and relevante parsing. Add a `usageMetadata` field
    on `GenerateContentResponse`.

    Add usage of the new field to the advanced text sample.

    Refactor the `GenerateContentResponse` parse method to handled each
    field individually at the top level. There is a behavior change for an
    error case, but it is not visible through the message formats that are
    returned from the backend in practice.

    Prepare to publish.

    Open source →
    Release notes
    • Add support for parsing the usageMetadata field in GenerateContentResponse messages.
    Open source →
  10. 0.3.2 27 Apr 2024
    Release notes
    • Use API version v1beta by default.
    • Add note to README warning about leaking API keys.
    Open source →
    Release notes
    • Use API version v1beta by default.
    • Add note to README warning about leaking API keys.
    Open source →
  11. 0.3.1 18 Apr 2024
    Release notes
    • Add support on content generating methods for overriding "tools" passed when
      the generative model was instantiated.
    • Add support for forcing the model to use or not use function calls to generate
      content.
    Open source →
    Release notes
    • Add support on content generating methods for overriding "tools" passed when the generative model was instantiated.
    • Add support for forcing the model to use or not use function calls to generate content.
    Open source →
  12. 0.3.0 11 Apr 2024
    Release notes
    • Allow specifying an API version in a requestOptions argument when constructing a model.
    • Add support for referring to uploaded files in request contents.
    • Add support for passing tools with functions the model may call while generating responses.
    • Add support for passing a system instruction when creating the model.
    • Breaking Added new subclasses FilePart, FunctionCall, and FunctionResponse of the sealed class Part.
    Open source →
  13. 0.2.3 04 Apr 2024
    Release notes
    • Update the package version that is sent with the HTTP client name.
    • Throw more actionable error objects than FormatException for errors. Errors were previously only correctly parsed in generateContent calls.
    • Add support for tuned models.
    • Add support for batchEmbedContents calls.
    Open source →
  14. 0.2.2 28 Feb 2024
    Release notes
    • Remove usage of new SDK features - support older SDKs 3.0 and above.
    Open source →
  15. 0.2.1 22 Feb 2024
    Release notes
    • Fix an issue parsing generateContent() responses that do not include content (this can occur for some finishReasons).
    • Fix an issue parsing generateContent() responses that include citation sources with unpopulated fields
    • Add link to ai.google.dev docs.
    Open source →
  16. 0.2.0 14 Feb 2024
    Release notes
    • Breaking HarmCategory.unknown renamed to unspecified. Removed unused unknown values in the HarmProbability and FinishReason enums.
    • Add additional API documentation.
    • Update the getting started instructions in the readme.
    Open source →
  17. 0.1.0 09 Feb 2024
    Release notes
    • Initial release.
    Open source →
  18. 0.0.1-dev 01 Feb 2024 pre-release

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive