# AgentResponseFormat

> 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.agentresponseformat/
> Summary: AgentResponseFormat: The definition of a structured output.

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

The definition of a structured output.

```csharp
public sealed record AgentResponseFormat : IEquatable<AgentResponseFormat>
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.agentresponseformat/">AgentResponseFormat</a></dd><dt>Implements</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.iequatable-1">IEquatable&lt;AgentResponseFormat&gt;</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

When [ModelBinding.ResponseFormat](/api/tracon.modelbinding/#Tracon_ModelBinding_ResponseFormat) is [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) today's
behaviour does not change and no format constraint is sent to the provider. This
type takes effect only when the user asks for a format explicitly.

Validation happens while the agent is built (`AgentDefinitionCompiler`):
[AgentResponseFormat.Schema](/api/tracon.agentresponseformat/#Tracon_AgentResponseFormat_Schema) cannot be empty while [AgentResponseFormat.Kind](/api/tracon.agentresponseformat/#Tracon_AgentResponseFormat_Kind) is
[AgentResponseFormatKind.JsonSchema](/api/tracon.agentresponseformatkind/), and it cannot be populated in the
other modes. [AgentResponseFormat.Schema](/api/tracon.agentresponseformat/#Tracon_AgentResponseFormat_Schema) must be a JSON **object**; its content
is not validated.

## Constructors

### <a id="Tracon_AgentResponseFormat__ctor"></a> AgentResponseFormat\(\)

```csharp
public AgentResponseFormat()
```

## Properties

### <a id="Tracon_AgentResponseFormat_Kind"></a> Kind

Gets the requested format.

```csharp
public required AgentResponseFormatKind Kind { get; init; }
```

#### Property Value

 [AgentResponseFormatKind](/api/tracon.agentresponseformatkind/)

### <a id="Tracon_AgentResponseFormat_Schema"></a> Schema

Gets the JSON schema. It is populated only for
[AgentResponseFormatKind.JsonSchema](/api/tracon.agentresponseformatkind/) and must be a JSON
**object**.

```csharp
public JsonElement? Schema { get; init; }
```

#### Property Value

 [JsonElement](https://learn.microsoft.com/dotnet/api/system.text.json.jsonelement)?

### <a id="Tracon_AgentResponseFormat_SchemaDescription"></a> SchemaDescription

Gets the description of the schema.

```csharp
public string? SchemaDescription { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)?

### <a id="Tracon_AgentResponseFormat_SchemaName"></a> SchemaName

Gets the name of the schema. The provider can pass it on to the model.

```csharp
public string? SchemaName { get; init; }
```

#### Property Value

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

### <a id="Tracon_AgentResponseFormat_Equals_System_Object_"></a> Equals\(object?\)

```csharp
public override bool Equals(object? obj)
```

#### Parameters

`obj` [object](https://learn.microsoft.com/dotnet/api/system.object)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_AgentResponseFormat_Equals_Tracon_AgentResponseFormat_"></a> Equals\(AgentResponseFormat?\)

```csharp
public bool Equals(AgentResponseFormat? other)
```

#### Parameters

`other` [AgentResponseFormat](/api/tracon.agentresponseformat/)?

#### Returns

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

```csharp
public override int GetHashCode()
```

#### Returns

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

```csharp
public override string ToString()
```

#### Returns

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

### <a id="Tracon_AgentResponseFormat_op_Equality_Tracon_AgentResponseFormat_Tracon_AgentResponseFormat_"></a> operator ==\(AgentResponseFormat?, AgentResponseFormat?\)

```csharp
public static bool operator ==(AgentResponseFormat? left, AgentResponseFormat? right)
```

#### Parameters

`left` [AgentResponseFormat](/api/tracon.agentresponseformat/)?

`right` [AgentResponseFormat](/api/tracon.agentresponseformat/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_AgentResponseFormat_op_Inequality_Tracon_AgentResponseFormat_Tracon_AgentResponseFormat_"></a> operator \!=\(AgentResponseFormat?, AgentResponseFormat?\)

```csharp
public static bool operator !=(AgentResponseFormat? left, AgentResponseFormat? right)
```

#### Parameters

`left` [AgentResponseFormat](/api/tracon.agentresponseformat/)?

`right` [AgentResponseFormat](/api/tracon.agentresponseformat/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)
