Langue

ChatResponseFormat Classe

Définition

Représente le format de réponse souhaité par l’appelant.

public ref class ChatResponseFormat
[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
[<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")>]
type ChatResponseFormat = class
Public Class ChatResponseFormat
Héritage
ChatResponseFormat
Dérivé
Attributs

Propriétés

Nom Description
Json

Obtient une instance singleton représentant des données JSON structurées, mais sans schéma particulier.

Text

Obtient une instance singleton représentant des données textuelles non structurées.

Méthodes

Nom Description
ForJsonSchema(JsonElement, String, String)

Crée une ChatResponseFormatJson représentation de données JSON structurées avec le schéma spécifié.

ForJsonSchema(Type, JsonSerializerOptions, String, String)

Crée une ChatResponseFormatJson représentation de données JSON structurées avec un schéma basé sur schemaType.

ForJsonSchema<T>(JsonSerializerOptions, String, String)

Crée une ChatResponseFormatJson représentation de données JSON structurées avec un schéma basé sur T.

Méthodes d’extension

Nom Description
AsOpenAIChatResponseFormat(ChatResponseFormat, ChatOptions)

Crée un OpenAI ChatResponseFormat à partir d’un ChatResponseFormat.

AsOpenAIResponseTextFormat(ChatResponseFormat, ChatOptions)

Crée un OpenAI ResponseTextFormat à partir d’un ChatResponseFormat.

S’applique à