# TraconImageOptions

> 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.traconimageoptions/
> Summary: TraconImageOptions: Settings for the image-generation tool.

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

Settings for the image-generation tool.

```csharp
public sealed class TraconImageOptions
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.traconimageoptions/">TraconImageOptions</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.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>

## Remarks

The tool is off by default. Setting [TraconImageOptions.Enabled](/api/tracon.traconimageoptions/#Tracon_TraconImageOptions_Enabled) to [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool)
registers `generate_image` only when an `AI.IImageGenerator`
is also registered.

## Constructors

### <a id="Tracon_TraconImageOptions__ctor"></a> TraconImageOptions\(\)

```csharp
public TraconImageOptions()
```

## Fields

### <a id="Tracon_TraconImageOptions_SectionName"></a> SectionName

Default configuration section name.

```csharp
public const string SectionName = "Tracon:Images"
```

#### Field Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)

## Properties

### <a id="Tracon_TraconImageOptions_Enabled"></a> Enabled

Gets or sets whether the image tool and operator endpoint are enabled.

```csharp
public bool Enabled { get; set; }
```

#### Property Value

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_TraconImageOptions_MaxImagesPerRequest"></a> MaxImagesPerRequest

Gets or sets the most images one call may produce. Default is one.

```csharp
public int MaxImagesPerRequest { get; set; }
```

#### Property Value

 [int](https://learn.microsoft.com/dotnet/api/system.int32)

### <a id="Tracon_TraconImageOptions_Model"></a> Model

Gets or sets the image model.

```csharp
public string? Model { get; set; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)?

#### Remarks

Image model names are not inferred from a chat model. Providers use distinct
model catalogues, and an inferred name could spend money on the wrong model.

### <a id="Tracon_TraconImageOptions_Provider"></a> Provider

Gets or sets the provider name used to find configured image prices.

```csharp
public string? Provider { get; set; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)?

#### Remarks

Provider extensions set this value when it is empty. Set it explicitly when
registering a custom `AI.IImageGenerator`.

### <a id="Tracon_TraconImageOptions_Timeout"></a> Timeout

Gets or sets the longest one `generate_image` call may run. Default
is two minutes.

```csharp
public TimeSpan Timeout { get; set; }
```

#### Property Value

 [TimeSpan](https://learn.microsoft.com/dotnet/api/system.timespan)

#### Remarks

The installation-wide `Tracon:Tools:DefaultTimeout` is 30 seconds,
which suits a tool that reads a database or calls an API. Image
generation does not belong in that class: a measured `gpt-image-1`
request routinely needs 30 to 35 seconds, so the generic default cut off
a call that was about to succeed and the model was told it had failed.

A shorter value is legitimate for an installation that would rather fail
fast. The charge is not lost either way: a call that outlives its
timeout is cancelled, and if the provider finishes anyway the spend is
recorded against the original call
([ToolInvocationRecord.LateCompletedAt](/api/tracon.toolinvocationrecord/#Tracon_ToolInvocationRecord_LateCompletedAt)).

Must be from one millisecond to about 49.7 days; any other value fails at startup.
