Tracon.Google
1.0.0-preview.8
Prefix Reserved
See the version list below for details.
dotnet add package Tracon.Google --version 1.0.0-preview.8
NuGet\Install-Package Tracon.Google -Version 1.0.0-preview.8
<PackageReference Include="Tracon.Google" Version="1.0.0-preview.8" />
<PackageVersion Include="Tracon.Google" Version="1.0.0-preview.8" />
<PackageReference Include="Tracon.Google" />
paket add Tracon.Google --version 1.0.0-preview.8
#r "nuget: Tracon.Google, 1.0.0-preview.8"
#:package Tracon.Google@1.0.0-preview.8
#addin nuget:?package=Tracon.Google&version=1.0.0-preview.8&prerelease
#tool nuget:?package=Tracon.Google&version=1.0.0-preview.8&prerelease
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.
Speech and dialogue
After UseGoogle(...), call UseGoogleSpeech(...) to register a Gemini text-to-speech model as a
named speech provider. The same instance speaks one voice and voices a dialogue of two.
tracon.UseGoogleSpeech(options =>
{
options.Model = "gemini-3.8-flash-tts";
options.Voices.Add(new VoiceDescriptor { VoiceId = "Kore", Name = "Kore" });
options.Voices.Add(new VoiceDescriptor { VoiceId = "Puck", Name = "Puck" });
});
- One voice.
POST /api/voice/speakwith"provider": "gemini"and a prebuilt voice name (Kore) asvoiceIdanswers a WAV file.OutputFormattakeswav(the default) orpcm; another format is refused before the call. - A dialogue.
ISpeechProviderResolver.GetDialogueSynthesizerAsync("gemini")returns the same instance. Gemini takes exactly two voices per request; a request for timestamps is refused because Gemini reports no timing.GET /api/voice/providerslists the limits indialogue. - The speaker format follows the model generation. The
gemini-3.8models want the speaker on each text part and refuse a label in the text;gemini-2.5-flash-preview-ttsandgemini-3.1-flash-tts-previewwant a label in the text and refuse the part metadata. SetDialogueSpeakerModetoPartMetadata(the default) orTextLabelsto match the model. A model that gets the wrong one answers400, and the error names the other mode. - The audio container follows the model too. The
gemini-3.8models answer a WAV file, and append aC2PAprovenance chunk after the samples; the older models answer raw 16-bit PCM. Awavrequest returns the model's own file, or wraps the PCM in a header. Apcmrequest returns the samples alone. The sample rate is the one the answer states (24 kHz so far). - Streaming (
SynthesizeStreamingAsync) yields raw PCM, never a WAV header. Whether the model streams in many parts depends on the model:gemini-3.8-flash-ttssends the first part after about a second,gemini-2.5-flash-preview-ttssends the whole audio as one part. - Tenants. Every call passes the tenant's egress policy against the provider name
google, the name the chat provider has. A tenant with its own Google key is served with that key, on the same client its chat requests use. - Billing is an estimate. Gemini bills speech by tokens and the answer carries no character
count, so Tracon records the length of the text and labels it as estimated. A character price under
Tracon:Pricing:Voice:google:{model}gives the cost; the price reader comes withUseVoice().
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.
Not Native AOT-compatible. The package's own code is analyzer-clean
(IsAotCompatible=true), but the SDK's credential library (Google.Apis.Auth)
uses reflection-based JSON (Newtonsoft.Json): a Native AOT publish of an app that
calls the provider emits about 100 trim and AOT warnings. Measured 2026-10-17 with
Google.GenAI 1.26.1. Not measured again on 1.27.0.
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. The run completes and records a tracon.output.filtered event,
so the record says why the answer ends where it does.
Known behavioral differences
- Model names go stale quickly. Measured: calling
gemini-2.5-flashreturned "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-flashrather thangemini-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.
Links
- Guide: https://tracon.dev/guides/model-providers/
- Speech and dialogue: https://tracon.dev/guides/gemini-speech/
- Capability map: https://tracon.dev/capabilities/
- API reference: https://tracon.dev/api/
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 | Versions 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. |
-
net10.0
- Google.GenAI (>= 1.27.0)
- Tracon.Core (= 1.0.0-preview.8)
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.12 | 59 | 11/15/2026 | |
| 1.0.0-preview.11 | 65 | 11/11/2026 | |
| 1.0.0-preview.10 | 65 | 11/11/2026 | |
| 1.0.0-preview.8 | 91 | 11/8/2026 | |
| 1.0.0-preview.6 | 116 | 10/27/2026 | |
| 1.0.0-preview.5 | 68 | 10/27/2026 | |
| 1.0.0-preview.4 | 105 | 10/15/2026 | |
| 1.0.0-preview.3 | 119 | 9/24/2026 | |
| 1.0.0-preview.2 | 109 | 9/20/2026 | |
| 1.0.0-preview.1 | 94 | 9/20/2026 |