Langue

AIJsonUtilities.CreateJsonSchema Méthode

Définition

Crée un schéma JSON pour le type spécifié.

public static System.Text.Json.JsonElement CreateJsonSchema(Type? type, string? description = default, bool hasDefaultValue = false, object? defaultValue = default, System.Text.Json.JsonSerializerOptions? serializerOptions = default, Microsoft.Extensions.AI.AIJsonSchemaCreateOptions? inferenceOptions = default);
static member CreateJsonSchema : Type * string * bool * obj * System.Text.Json.JsonSerializerOptions * Microsoft.Extensions.AI.AIJsonSchemaCreateOptions -> System.Text.Json.JsonElement
Public Function CreateJsonSchema (type As Type, Optional description As String = Nothing, Optional hasDefaultValue As Boolean = false, Optional defaultValue As Object = Nothing, Optional serializerOptions As JsonSerializerOptions = Nothing, Optional inferenceOptions As AIJsonSchemaCreateOptions = Nothing) As JsonElement

Paramètres

type
Type

Type pour lequel générer le schéma.

description
String

Description du paramètre.

hasDefaultValue
Boolean

true si le paramètre est facultatif ; sinon, false.

defaultValue
Object

Valeur par défaut du paramètre facultatif, le cas échéant.

serializerOptions
JsonSerializerOptions

Options utilisées pour extraire le schéma du type spécifié.

inferenceOptions
AIJsonSchemaCreateOptions

Options de contrôle de la création du schéma.

Retours

Représentant JsonElement le schéma.

Remarques

Utilise une clé de cache sur le résultat du schéma pour stocker le serializerOptions résultat du schéma, sauf si un TransformSchemaNode délégué a été spécifié.

S’applique à