Skip to content

AgentResponseFormat

Namespace AgentPrism · Assembly AgentPrism.Abstractions.dll

The definition of a structured output.

public sealed record AgentResponseFormat : IEquatable<AgentResponseFormat>

objectAgentResponseFormat

IEquatable<AgentResponseFormat>

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

When ModelBinding.ResponseFormat is 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 cannot be empty while AgentResponseFormat.Kind is AgentResponseFormatKind.JsonSchema, and it cannot be populated in the other modes. AgentResponseFormat.Schema must be a JSON object; its content is not validated.

public AgentResponseFormat()

Gets the requested format.

public required AgentResponseFormatKind Kind { get; init; }

AgentResponseFormatKind

Gets the JSON schema. It is populated only for AgentResponseFormatKind.JsonSchema and must be a JSON object.

public JsonElement? Schema { get; init; }

JsonElement?

Gets the description of the schema.

public string? SchemaDescription { get; init; }

string?

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

public string? SchemaName { get; init; }

string?

public override bool Equals(object? obj)

obj object?

bool

public bool Equals(AgentResponseFormat? other)

other AgentResponseFormat?

bool

public override int GetHashCode()

int

public override string ToString()

string

operator ==(AgentResponseFormat?, AgentResponseFormat?)

Section titled “ operator ==(AgentResponseFormat?, AgentResponseFormat?)”
public static bool operator ==(AgentResponseFormat? left, AgentResponseFormat? right)

left AgentResponseFormat?

right AgentResponseFormat?

bool

operator !=(AgentResponseFormat?, AgentResponseFormat?)

Section titled “ operator !=(AgentResponseFormat?, AgentResponseFormat?)”
public static bool operator !=(AgentResponseFormat? left, AgentResponseFormat? right)

left AgentResponseFormat?

right AgentResponseFormat?

bool