.NET API
GoogleImageBuilderExtensions
Tracon.Google.dllAdds Google image generation to the Tracon chain.
public static class GoogleImageBuilderExtensions- Inheritance
- object ← GoogleImageBuilderExtensions
- Inherited Members
- object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Methods
Section titled “Methods”UseGoogleImages(ITraconBuilder, Action<TraconImageOptions>?)
Section titled “ UseGoogleImages(ITraconBuilder, Action<TraconImageOptions>?)”Registers the Google image generator.
public static ITraconBuilder UseGoogleImages(this ITraconBuilder builder, Action<TraconImageOptions>? configure = null)Parameters
Section titled “Parameters”builder ITraconBuilder
The Tracon chain.
configure Action<TraconImageOptions>?
Optional image-tool settings.
Returns
Section titled “Returns”The continuation of the chain.
Remarks
Section titled “Remarks”Call GoogleProviderExtensions.UseGoogle first. Google.GenAI has no Microsoft.Extensions.AI image adapter, so this call registers Tracon’s narrow GenerateAsync-only adapter.
The model must be one that generates images through
generateContent, such as a Gemini image model. The older
Imagen predict surface is not served by the Gemini API and a
model that only supports it fails every request.
The adapter generates from a prompt only. 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 what was asked
for. Omit it to accept the model’s own choice.
builder.AddTracon() .UseGoogle(builder.Configuration["Google:ApiKey"]!) .UseGoogleImages(options => { options.Enabled = true; options.Model = "gemini-2.5-flash-image"; });