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 2025Releases
latest 18-
0.4.717 Apr 2025Release notes
Open source →- Update the README.md to indicate that this package is deprecated; using the Firebase SDK is the preferred path forward.
-
0.4.604 Sep 2024Release notes
Open source →We do not expect format exceptions to occur unless the server API is
changing. Change from a plainFormatExceptionto a specific exception
which indicates the two possible resolution strategies - upgrade if not
already on the latest SDK, or file an issue. -
0.4.516 Aug 2024Release notes
Open source →- Add support for model side Code Execution. Enable code execution by
configuringToolswith acodeExecutionargument. - Use a default role
'model'when a chat response comes back with no role.
Release notes
Open source →- Add support for model side Code Execution. Enable code execution by
configuring
Toolswith acodeExecutionargument. - Use a default role
'model'when a chat response comes back with no role.
- Add support for model side Code Execution. Enable code execution by
-
0.4.401 Aug 2024Release notes
Open source →Fixes #184
The vertex backend uses a similar data model, but names the field
citationsinstead ofcitationSources. Read either field, whichever
exists, and parse it otherwise consistently.Release notes
Open source →- Allow the Vertex format for citation metadata - read either
citationSourcesorcitationskeys, whichever exists. Fixes aFormatExceptionwhen parsing vertex results with citations.
- Allow the Vertex format for citation metadata - read either
-
0.4.305 Jun 2024Release notes
Open source →Maintains the internal details of using the client, but offers a general
escape hatch for any unary request by exposingTask.Add a
makeRequestutility method in an extension, and update the
existing unary requests to use it.Release notes
Open source →- Internal changes to enable reuse in the Vertex SDK. No user visible changes.
-
0.4.230 May 2024Release notes
Open source →- Add support for
GenerationConfig.responseSchemafor constraining JSON mime
type output formats. - Require Dart 3.1.
Release notes
Open source →- Add support for
GenerationConfig.responseSchemafor constraining JSON mime type output formats. - Require Dart 3.1.
- Add support for
-
0.4.123 May 2024Release notes
Open source →- Concatenate multiple
TextPartinto thetextString in case the model
replies with more than one part. - Fix handling of
formatargument toSchema.numberandSchema.integer. - Export
UsageMetadata. - Include the full
GenerateContentRequest(previously omitted
safetySettings,generationConfig,tools,toolConfig, and
systemInstruction) incountTokensrequests. This aligns the token count
with the token count the backend will see in practice for a
generateContentrequest. - Add a
textgetter onCandidateto make it easer to retrieve the text from
candidates other than the first in a response.
Release notes
Open source →- Concatenate multiple
TextPartinto thetextString in case the model replies with more than one part. - Fix handling of
formatargument toSchema.numberandSchema.integer. - Export
UsageMetadata. - Include the full
GenerateContentRequest(previously omittedsafetySettings,generationConfig,tools,toolConfig, andsystemInstruction) incountTokensrequests. This aligns the token count with the token count the backend will see in practice for agenerateContentrequest. - Add a
textgetter onCandidateto make it easer to retrieve the text from candidates other than the first in a response.
- Concatenate multiple
-
0.4.010 May 2024Release notes
Open source →- Add support for parsing Vertex AI specific fields in
CountTokensResponse. - Add named constructors on
Schemafor each value type. - Add
GenerationConfig.responseMimeTypewhich supports setting
'application/json'to force the model to reply with JSON parseable output. - Add
outputDimensionalityargument support forembedContentand
batchEmbedContent. - Add
Content.functionResponsesutility to reply to multiple function calls in
parallel. - Breaking The
Partclass is no longersealed. Exhaustive switches over
aPartinstance will need to add a wildcard case.
Release notes
Open source →- Add support for parsing Vertex AI specific fields in
CountTokensResponse. - Add named constructors on
Schemafor each value type. - Add
GenerationConfig.responseMimeTypewhich supports setting'application/json'to force the model to reply with JSON parseable output. - Add
outputDimensionalityargument support forembedContentandbatchEmbedContent. - Add
Content.functionResponsesutility to reply to multiple function calls in parallel. - Breaking The
Partclass is no longersealed. Exhaustive switches over aPartinstance will need to add a wildcard case.
- Add support for parsing Vertex AI specific fields in
-
0.3.307 May 2024Release notes
Open source →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.
Release notes
Open source →- Add support for parsing the
usageMetadatafield inGenerateContentResponsemessages.
- Add support for parsing the
-
0.3.227 Apr 2024Release notes
Open source →- Use API version
v1betaby default. - Add note to README warning about leaking API keys.
Release notes
Open source →- Use API version
v1betaby default. - Add note to README warning about leaking API keys.
- Use API version
-
0.3.118 Apr 2024Release notes
Open source →- 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.
Release notes
Open source →- 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.
- Add support on content generating methods for overriding "tools" passed when
-
0.3.011 Apr 2024Release notes
Open source →- Allow specifying an API version in a
requestOptionsargument 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, andFunctionResponseof the sealed classPart.
- Allow specifying an API version in a
-
0.2.304 Apr 2024Release notes
Open source →- Update the package version that is sent with the HTTP client name.
- Throw more actionable error objects than
FormatExceptionfor errors. Errors were previously only correctly parsed ingenerateContentcalls. - Add support for tuned models.
- Add support for
batchEmbedContentscalls.
-
0.2.228 Feb 2024 -
0.2.122 Feb 2024Release notes
Open source →- Fix an issue parsing
generateContent()responses that do not include content (this can occur for somefinishReasons). - Fix an issue parsing
generateContent()responses that include citation sources with unpopulated fields - Add link to ai.google.dev docs.
- Fix an issue parsing
-
0.2.014 Feb 2024Release notes
Open source →- Breaking
HarmCategory.unknownrenamed tounspecified. Removed unusedunknownvalues in theHarmProbabilityandFinishReasonenums. - Add additional API documentation.
- Update the getting started instructions in the readme.
- Breaking
-
0.1.009 Feb 2024 -
0.0.1-dev01 Feb 2024 pre-releaseNothing published for this version