ChatResponseFormat Class

Definition

Represents the response format that is desired by the caller.

C#
[System.Text.Json.Serialization.JsonDerivedType(typeof(Microsoft.Extensions.AI.ChatResponseFormatText), "text")]
[System.Text.Json.Serialization.JsonDerivedType(typeof(Microsoft.Extensions.AI.ChatResponseFormatJson), "json")]
[System.Text.Json.Serialization.JsonPolymorphic(TypeDiscriminatorPropertyName="$type")]
public class ChatResponseFormat
Inheritance
ChatResponseFormat
Derived
Attributes

Properties

Json

Gets a singleton instance representing structured JSON data but without any particular schema.

Text

Gets a singleton instance representing unstructured textual data.

Methods

ForJsonSchema(JsonElement, String, String)

Creates a ChatResponseFormatJson representing structured JSON data with the specified schema.

Applies to

Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided)