Tracon.Google 1.0.0-preview.2

Prefix Reserved
This is a prerelease version of Tracon.Google.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Tracon.Google --version 1.0.0-preview.2
                    
NuGet\Install-Package Tracon.Google -Version 1.0.0-preview.2
                    
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="Tracon.Google" Version="1.0.0-preview.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Tracon.Google" Version="1.0.0-preview.2" />
                    
Directory.Packages.props
<PackageReference Include="Tracon.Google" />
                    
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 Tracon.Google --version 1.0.0-preview.2
                    
#r "nuget: Tracon.Google, 1.0.0-preview.2"
                    
#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 Tracon.Google@1.0.0-preview.2
                    
#: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=Tracon.Google&version=1.0.0-preview.2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Tracon.Google&version=1.0.0-preview.2&prerelease
                    
Install as a Cake Tool

Tracon.Google

Google Gemini provider adapter for Tracon.

Image generation

After UseGoogle(...), call UseGoogleImages(...) to register Tracon's narrow IImageGenerator adapter. Set an image-capable Google model explicitly.

tracon.UseGoogleImages(options =>
{
    options.Enabled = true;
    options.Model = "gemini-2.5-flash-image";
});

The model must generate images through generateContent. The older Imagen predict surface is not served by the Gemini API, and a model that only supports it fails every request.

The generator key is google. This adapter generates from a prompt only; it does not map a WIDTHxHEIGHT request because Google's image API uses separate aspect-ratio and size-tier settings. Count is passed as the candidate count, and an image model commonly returns one image whatever you ask for. A requested media type is passed to the model and the answer is checked: if the model returns another format the call fails rather than handing back bytes that do not match the request. Configure prices under Tracon:Pricing:Images:google when cost reporting is required.

builder.AddTracon()
       .UseGoogle(apiKey, o => o.DefaultModel = "gemini-3.6-flash");

Registered provider name: google (GoogleProviderNames.Google).

Model = new ModelBinding
{
    Provider = GoogleProviderNames.Google,
    Model = "gemini-3.6-flash",
}

The name is google, not gemini: the same package may cover Vertex AI in the future and should not be locked to the model family's name.

Every IChatClient produced goes through the same pipeline as Tracon.OpenAI: UseFunctionInvocation() leaves the tool-call loop to the Microsoft Agent Framework, UseOpenTelemetry() produces spans under the Tracon source. Circuit breaker and content filter detection live at the ModelProviderRegistry level.

SDK used and dependency weight

The official Google.GenAI package (owner: Google LLC, Apache-2.0). The package carries its own AsIChatClient adapter.

This package is heavier than the others. Newtonsoft.Json, System.Management, and System.CodeDom come in transitively via Google.Apis.Auth. The weight is a deliberate trade-off and is kept isolated inside this package: a consumer not using Gemini pulls in none of it. Other Tracon packages are unaffected by these dependencies.

The package is AOT-compatible (IsAotCompatible=true, zero warnings).

Provider-specific settings

Supplied per agent via the ModelBinding.ProviderSettings dictionary. A key not in this list is not silently ignored — it produces a build error, and the message lists the supported keys.

Key Type Description
google.safety.harassment string Harassment threshold
google.safety.hateSpeech string Hate speech threshold
google.safety.sexuallyExplicit string Sexual content threshold
google.safety.dangerousContent string Dangerous content threshold
google.safety.civicIntegrity string Civic integrity threshold
google.thinking.budgetTokens integer Thinking budget, [-1, 65535]
google.thinking.includeThoughts boolean Whether a thinking summary is returned in the response

Valid threshold values: BLOCK_LOW_AND_ABOVE, BLOCK_MEDIUM_AND_ABOVE, BLOCK_ONLY_HIGH, BLOCK_NONE, OFF. An unrecognized value produces a build error and lists the valid values.

ProviderSettings = new Dictionary<string, JsonElement>(StringComparer.OrdinalIgnoreCase)
{
    ["google.safety.harassment"] = JsonSerializer.SerializeToElement("BLOCK_ONLY_HIGH"),
    ["google.thinking.budgetTokens"] = JsonSerializer.SerializeToElement(512),
}

Safety filter produces an empty response

When Gemini's safety filter kicks in, the response comes back empty and the finish reason is content_filter. Tracon does not treat this as "succeeded but empty": the run is recorded with Failed status and RunError.Type = "content_filtered". A silent empty response is the hardest kind of failure to debug.

Detection lives in a shared decorator inside Tracon.Core; if the model produced text before being cut off (a partial response), no error is thrown — there is a usable answer in hand.

Known behavioral differences

  • Model names go stale quickly. Measured: calling gemini-2.5-flash returned "This model is no longer available to new users". The catalog comes from configuration and is not a validation list.
  • The model list carries a resource path. The health endpoint returns models/gemini-3.6-flash rather than gemini-3.6-flash; the prefix is stripped.
  • The system message is a separate field (systemInstruction); the SDK handles the conversion.
  • Usage counters arrive at the end when streaming.

Health check

Hits GET {endpoint}/{apiVersion}/models, which produces no charge. Authentication is done with the x-goog-api-key header — the key is deliberately not put in the query string, because query strings get written in plain text to proxy and access logs.

GET /tracon/api/models/health/google

Model catalog

{
  "Tracon": {
    "Providers": {
      "Google": {
        "ApiKey": "",
        "DefaultModel": "gemini-3.6-flash",
        "Models": [
          { "Name": "gemini-3.6-flash", "DisplayName": "Gemini 3.6 Flash",
            "ContextWindowTokens": 1048576, "MaxOutputTokens": 65536,
            "SupportsReasoning": true }
        ]
      }
    }
  }
}

ApiKey is never written to this file — use dotnet user-secrets.

Licence: PolyForm Small Business 1.0.0 - free below 100 people and 1,000,000 USD (2019, inflation adjusted) revenue; a commercial licence applies above that. Terms ship in the package as LICENSE.md. Details: https://tracon.dev/reference/licensing/

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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. 
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
1.0.0-preview.3 41 9/24/2026
1.0.0-preview.2 74 9/20/2026
1.0.0-preview.1 53 9/20/2026