Skip to content
Tracon

OpenAIImageBuilderExtensions

Namespace Tracon · Assembly Tracon.OpenAI.dll

Adds OpenAI image generation to the Tracon chain.

public static class OpenAIImageBuilderExtensions

objectOpenAIImageBuilderExtensions

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

UseOpenAIImages(ITraconBuilder, Action<TraconImageOptions>?)

Section titled “ UseOpenAIImages(ITraconBuilder, Action<TraconImageOptions>?)”

Registers the OpenAI image generator.

public static ITraconBuilder UseOpenAIImages(this ITraconBuilder builder, Action<TraconImageOptions>? configure = null)

builder ITraconBuilder

The Tracon chain.

configure Action<TraconImageOptions>?

Optional image-tool settings.

ITraconBuilder

The continuation of the chain.

Call OpenAIProviderExtensions.UseOpenAI first. This call shares its authenticated OpenAIChatClientFactory and does not add a package or a second connection pool.

The generate_image tool stays absent until TraconImageOptions.Enabled is true. Registering this generator alone does not expose a paid capability to agents.

builder.AddTracon()
.UseOpenAI(builder.Configuration["OpenAI:ApiKey"]!)
.UseOpenAIImages(options =>
{
options.Enabled = true;
options.Model = "gpt-image-1";
});