![]() |
VOOZH | about |
dotnet add package GeminiDotnet --version 0.25.0
NuGet\Install-Package GeminiDotnet -Version 0.25.0
<PackageReference Include="GeminiDotnet" Version="0.25.0" />
<PackageVersion Include="GeminiDotnet" Version="0.25.0" />Directory.Packages.props
<PackageReference Include="GeminiDotnet" />Project file
paket add GeminiDotnet --version 0.25.0
#r "nuget: GeminiDotnet, 0.25.0"
#:package GeminiDotnet@0.25.0
#addin nuget:?package=GeminiDotnet&version=0.25.0Install as a Cake Addin
#tool nuget:?package=GeminiDotnet&version=0.25.0Install as a Cake Tool
This package provides the tools to interact with the Google Gemini models in .NET.
This package is lightweight, has no external dependencies, is Native AOT compatible, uses System.Text.Json for performant serialization, and provides a model directly mapping to the Google Gemini API's structure.
For an API you can use with other models and a more user-friendly API, you should consider interacting with this library through the GeminiDotnet.Extensions.AI package, which exposes Microsoft.Extensions.AI.Abstractions API implementations, including a full IChatClient implementation. For more information about why this may be preferred, you can read the Microsoft.Extensions.AI announcement blog post.
You can install this package into your project as follows.
dotnet add package GeminiDotnet
Then, you can create and use the GeminiClient to interact with the Google Gemini API as follows.
using GeminiDotnet;
var options = new GeminiClientOptions
{
ApiKey = "<your-api-key>"
};
var client = new GeminiClient(options);
var request = new GenerateContentRequest
{
Contents =
[
new ChatMessage
{
Role = ChatRoles.User,
Parts = [new Part { Text = "Who was the first person to walk on the moon?" }]
}
]
};
await foreach (var result in client.GenerateContentStreamingAsync("gemini-2.5-flash", request, cancellationToken))
{
// Use the result as it is returned.
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 2 NuGet packages that depend on GeminiDotnet:
| Package | Downloads |
|---|---|
|
GeminiDotnet.Extensions.AI
A lightweight, modern implementation of the Microsoft.Extensions.AI.Abstractions APIs for interacting with Google Gemini models. |
|
|
AIKit.Clients.Gemini
Google Gemini client provider for AIKit, supporting chat. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.25.0 | 5,899 | 5/4/2026 |
| 0.24.0 | 606 | 4/27/2026 |
| 0.23.0 | 9,704 | 3/11/2026 |
| 0.22.0 | 6,740 | 2/13/2026 |
| 0.21.0 | 9,213 | 1/22/2026 |
| 0.20.0 | 10,241 | 1/9/2026 |
| 0.19.7 | 789 | 1/2/2026 |
| 0.19.6-ge41ebb5b06 | 143 | 1/2/2026 |
| 0.19.4-g6c44932266 | 135 | 1/2/2026 |
| 0.19.3-alpha | 141 | 1/2/2026 |
| 0.19.2-alpha-g2f6eb372c3 | 145 | 1/2/2026 |
| 0.18.1 | 5,011 | 12/17/2025 |
| 0.18.0 | 1,752 | 12/10/2025 |
| 0.17.2 | 3,890 | 12/4/2025 |
| 0.17.0 | 2,754 | 11/18/2025 |
| 0.16.0 | 664 | 11/12/2025 |
| 0.15.0 | 6,730 | 10/8/2025 |
| 0.14.2 | 741 | 9/5/2025 |
| 0.14.1 | 1,427 | 7/17/2025 |
| 0.14.0 | 256 | 7/10/2025 |