Universal.Operative.Sdk.Google.Gemini 2.0.0

dotnet add package Universal.Operative.Sdk.Google.Gemini --version 2.0.0
                    
NuGet\Install-Package Universal.Operative.Sdk.Google.Gemini -Version 2.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Universal.Operative.Sdk.Google.Gemini" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Universal.Operative.Sdk.Google.Gemini" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Universal.Operative.Sdk.Google.Gemini" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Universal.Operative.Sdk.Google.Gemini --version 2.0.0
                    
#r "nuget: Universal.Operative.Sdk.Google.Gemini, 2.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Universal.Operative.Sdk.Google.Gemini@2.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Universal.Operative.Sdk.Google.Gemini&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Universal.Operative.Sdk.Google.Gemini&version=2.0.0
                    
Install as a Cake Tool

Universal.Operative.Sdk.Google.Gemini

Intent-focused Google Gemini tools for Universal.Operative.Sdk.

Default tools

  • gemini_image generates and edits images. Its stable quality profiles map to the current Nano Banana family: fast, balanced, and pro (Nano Banana Pro).
  • gemini_consult asks Gemini for analysis, reasoning, drafting, or a second opinion. Calls are stateless by default.

The lower-level gemini_api tool is available only from the advanced tool set. It allowlists supported operations and never accepts an arbitrary URL or HTTP method.

using Universal.Operative.Sdk.Google.Gemini;
using Universal.Operative.Sdk.Google.Gemini.Tools;
using Universal.Operative.Sdk.Tools;

using GoogleGeminiGateway gateway = new GoogleGeminiGateway("YOUR_GEMINI_API_KEY");
IReadOnlyList<ITool> tools = GoogleGeminiToolSet.CreateDefault(gateway);

To include the advanced API tool:

IReadOnlyList<ITool> tools = GoogleGeminiToolSet.CreateAdvanced(gateway);

Image tool

gemini_image accepts a prompt, optional reference images, an aspect ratio, output size, JPEG output, and a quality profile. Generated images are returned as native Operative ImageBlock values instead of base64 JSON text.

Quality profiles currently map as follows:

Profile Gemini model
fast Gemini 3.1 Flash-Lite Image
balanced Gemini 3.1 Flash Image (Nano Banana 2)
pro Gemini 3 Pro Image (Nano Banana Pro)

Reference images may be HTTPS/Gemini file URIs or local file paths. Local files are uploaded for the request and removed from Gemini Files afterward.

Conversation storage

Both default tools use the Interactions API. Requests set store=false unless gemini_consult is explicitly called with store=true. A stored response's interaction_id can be passed as previous_interaction_id on the next consultation.

Custom model mappings

Applications can replace model mappings without changing the tool schemas:

GoogleGeminiToolOptions options = new GoogleGeminiToolOptions
{
    ProImageModel = "gemini-3-pro-image",
    ReasoningConsultModel = "gemini-3.7-flash",
};
IReadOnlyList<ITool> tools = GoogleGeminiToolSet.CreateDefault(gateway, options);

Live tests

The test project shares the existing Google Gemini user-secret store. Its live tests call both the text tool and Nano Banana Pro through the real API:

dotnet user-secrets set "Google:Gemini:ApiKey" "<key>" --project Universal.Operative.Sdk.Google.Gemini.Tests
dotnet test Universal.Operative.Sdk.Google.Gemini.Tests --filter "TestCategory=GoogleGeminiLive"

Tool sets borrow the supplied gateway. API-key factory overloads have been removed: construct a using GoogleGeminiGateway, keep it alive while tools execute, then dispose it. Provider GeminiException values propagate unchanged with status and parsed error context. Uploaded references are all scheduled for deletion even after failure/cancellation; failed deletion throws an AggregateException whose inner failures include Data["GeminiFileName"]. If the operation also failed, its original exception is rethrown with Data["GeminiFileCleanupFailures"]. No payload is automatically logged. Advanced retrieval returns native image blocks for stored image interactions.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed.  net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0 82 11/18/2026
1.2.1 95 11/16/2026
1.2.0 114 11/11/2026
1.1.0 91 11/11/2026
1.0.1 110 11/10/2026
1.0.0 211 9/4/2026

Targets .NET 10 and .NET 11; removes .NET 8 support. Removed API-key tool-set overloads: own a GoogleGeminiGateway explicitly. Provider exceptions and reference cleanup failures retain context; stored image retrieval returns native image blocks.