# GoogleImageBuilderExtensions

> Tracon documentation. Tracon is a .NET package family that adds a control
> plane on Microsoft Agent Framework, published as NuGet packages that run
> inside your own ASP.NET Core application.
>
> Page: https://tracon.dev/api/tracon.googleimagebuilderextensions/
> Summary: GoogleImageBuilderExtensions: Adds Google image generation to the Tracon chain.

<div class="api-provenance">Namespace Tracon · Assembly <code>Tracon.Google.dll</code></div>

Adds Google image generation to the Tracon chain.

```csharp
public static class GoogleImageBuilderExtensions
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.googleimagebuilderextensions/">GoogleImageBuilderExtensions</a></dd><dt>Inherited Members</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone">object.MemberwiseClone()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a></dd></dl>

## Methods

### <a id="Tracon_GoogleImageBuilderExtensions_UseGoogleImages_Tracon_ITraconBuilder_System_Action_Tracon_TraconImageOptions__"></a> UseGoogleImages\(ITraconBuilder, Action<TraconImageOptions\>?\)

Registers the Google image generator.

```csharp
public static ITraconBuilder UseGoogleImages(this ITraconBuilder builder, Action<TraconImageOptions>? configure = null)
```

#### Parameters

`builder` [ITraconBuilder](/api/tracon.itraconbuilder/)

The Tracon chain.

`configure` [Action](https://learn.microsoft.com/dotnet/api/system.action\-1)<[TraconImageOptions](/api/tracon.traconimageoptions/)\>?

Optional image-tool settings.

#### Returns

 [ITraconBuilder](/api/tracon.itraconbuilder/)

The continuation of the chain.

#### Remarks

Call [GoogleProviderExtensions.UseGoogle](/api/tracon.googleproviderextensions/)
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.

```csharp
builder.AddTracon()
       .UseGoogle(builder.Configuration["Google:ApiKey"]!)
       .UseGoogleImages(options =>
       {
           options.Enabled = true;
           options.Model = "gemini-2.5-flash-image";
       });
```
