# ResponseSchemaShape

> 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.responseschemashape/
> Summary: ResponseSchemaShape: The response schema as a provider's client sends it to the model, and what differs from the schema the author wrote.

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

The response schema as a provider's client sends it to the model, and what differs from the
schema the author wrote.

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

A provider adapter may rewrite a response schema before it reaches the wire. The OpenAI adapters
do it for every request, strict or not: they close every object, make every property required and
move the bounds (`maxLength`, `pattern`, `minimum` and the like) out of the schema
into its `description` text. The model is asked for the rewritten schema, and a registered
[IStructuredResponseValidator](/api/tracon.istructuredresponsevalidator/) receives the schema as the author wrote it, so this shape is the
only place the author can see what the model was asked for.

JSON locations in [ResponseSchemaShape.OptionalMadeRequired](/api/tracon.responseschemashape/#Tracon_ResponseSchemaShape_OptionalMadeRequired) and [ResponseSchemaShape.KeywordsNotEnforced](/api/tracon.responseschemashape/#Tracon_ResponseSchemaShape_KeywordsNotEnforced) are
JSON Pointers into the author's schema, with `#` for the root: `#/properties/address`.

## Constructors

### <a id="Tracon_ResponseSchemaShape__ctor"></a> ResponseSchemaShape\(\)

```csharp
public ResponseSchemaShape()
```

## Properties

### <a id="Tracon_ResponseSchemaShape_EffectiveSchema"></a> EffectiveSchema

Gets the schema the provider's client sends to the model.

```csharp
public required JsonElement EffectiveSchema { get; init; }
```

#### Property Value

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

Gets the bounds of the author's schema that the client does not send as bounds, each as
`"<location>: <keyword>"`, for example `#/properties/name: maxLength`.
A registered [IStructuredResponseValidator](/api/tracon.istructuredresponsevalidator/) receives the schema as written and can still apply them.

```csharp
public IReadOnlyList<string> KeywordsNotEnforced { get; init; }
```

#### Property Value

 [IReadOnlyList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist\-1)<[string](https://learn.microsoft.com/dotnet/api/system.string)\>

### <a id="Tracon_ResponseSchemaShape_OptionalMadeRequired"></a> OptionalMadeRequired

Gets the properties the author left optional that the client sends as required, and whose
schema does not allow `null`. The model has to produce a value for each of them.

```csharp
public IReadOnlyList<string> OptionalMadeRequired { get; init; }
```

#### Property Value

 [IReadOnlyList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist\-1)<[string](https://learn.microsoft.com/dotnet/api/system.string)\>

#### Remarks

A property that must be allowed to stay empty accepts `null`, for example
`"type": ["string", "null"]`.

### <a id="Tracon_ResponseSchemaShape_Strict"></a> Strict

Gets a value that is [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) when the client asks the provider to enforce the
schema while the model generates (the provider's strict mode).

```csharp
public required bool Strict { get; init; }
```

#### Property Value

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

Gets the parts of the schema that the provider refuses to accept in strict mode, each as
`"<location>: <keyword>"`, for example `#/properties/answer: oneOf`. Empty when the
schema has none, and also when the provider cannot say.

```csharp
public IReadOnlyList<string> StrictUnsupported { get; init; }
```

#### Property Value

 [IReadOnlyList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist\-1)<[string](https://learn.microsoft.com/dotnet/api/system.string)\>

#### Remarks

A provider fills it only from a refusal it has measured against the real service. It is read when
[ResponseSchemaShape.Strict](/api/tracon.responseschemashape/#Tracon_ResponseSchemaShape_Strict) is [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool): the same schema runs without the keyword in the
provider's non-strict mode. The locations are in the schema the client sends
([ResponseSchemaShape.EffectiveSchema](/api/tracon.responseschemashape/#Tracon_ResponseSchemaShape_EffectiveSchema)).

## Methods

### <a id="Tracon_ResponseSchemaShape_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_ResponseSchemaShape_Equals_Tracon_ResponseSchemaShape_"></a> Equals\(ResponseSchemaShape?\)

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

`other` [ResponseSchemaShape](/api/tracon.responseschemashape/)?

#### Returns

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

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

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

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

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

### <a id="Tracon_ResponseSchemaShape_op_Equality_Tracon_ResponseSchemaShape_Tracon_ResponseSchemaShape_"></a> operator ==\(ResponseSchemaShape?, ResponseSchemaShape?\)

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

`left` [ResponseSchemaShape](/api/tracon.responseschemashape/)?

`right` [ResponseSchemaShape](/api/tracon.responseschemashape/)?

#### Returns

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

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

`left` [ResponseSchemaShape](/api/tracon.responseschemashape/)?

`right` [ResponseSchemaShape](/api/tracon.responseschemashape/)?

#### Returns

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