# StructuredResponseValidationContext

> 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.structuredresponsevalidationcontext/
> Summary: StructuredResponseValidationContext: The response an IStructuredResponseValidator checks.

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

The response an [IStructuredResponseValidator](/api/tracon.istructuredresponsevalidator/) checks.

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

## Constructors

### <a id="Tracon_StructuredResponseValidationContext__ctor"></a> StructuredResponseValidationContext\(\)

```csharp
public StructuredResponseValidationContext()
```

## Properties

### <a id="Tracon_StructuredResponseValidationContext_AgentName"></a> AgentName

Gets the name of the agent that produced the response.

```csharp
public required string AgentName { get; init; }
```

#### Property Value

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

Gets the requested response format.

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

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

Gets the model that produced the response, or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when unknown.

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

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

Gets the model provider that produced the response, or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when unknown.

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

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

Gets the response text. Already confirmed non-empty and parseable as JSON —
Tracon's own well-formedness check runs before this validator is called.

```csharp
public required string ResponseText { get; init; }
```

#### Property Value

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

Gets the identity of the run.

```csharp
public required Guid RunId { get; init; }
```

#### Property Value

 [Guid](https://learn.microsoft.com/dotnet/api/system.guid)

### <a id="Tracon_StructuredResponseValidationContext_Schema"></a> Schema

Gets the requested JSON schema. Populated only when [StructuredResponseValidationContext.Kind](/api/tracon.structuredresponsevalidationcontext/#Tracon_StructuredResponseValidationContext_Kind) is
[AgentResponseFormatKind.JsonSchema](/api/tracon.agentresponseformatkind/).

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

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

Gets the name of the schema, if the agent's definition supplied one.

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

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

Gets the session the run belongs to. [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) for a sessionless run.

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

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

### <a id="Tracon_StructuredResponseValidationContext_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_StructuredResponseValidationContext_Equals_Tracon_StructuredResponseValidationContext_"></a> Equals\(StructuredResponseValidationContext?\)

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

`other` [StructuredResponseValidationContext](/api/tracon.structuredresponsevalidationcontext/)?

#### Returns

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

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

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

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

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

### <a id="Tracon_StructuredResponseValidationContext_op_Equality_Tracon_StructuredResponseValidationContext_Tracon_StructuredResponseValidationContext_"></a> operator ==\(StructuredResponseValidationContext?, StructuredResponseValidationContext?\)

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

`left` [StructuredResponseValidationContext](/api/tracon.structuredresponsevalidationcontext/)?

`right` [StructuredResponseValidationContext](/api/tracon.structuredresponsevalidationcontext/)?

#### Returns

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

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

`left` [StructuredResponseValidationContext](/api/tracon.structuredresponsevalidationcontext/)?

`right` [StructuredResponseValidationContext](/api/tracon.structuredresponsevalidationcontext/)?

#### Returns

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