Taal

AIJsonUtilities.CreateJsonSchema Methode

Definitie

Hiermee maakt u een JSON-schema voor het opgegeven type.

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

Parameters

type
Type

Het type waarvoor het schema moet worden gegenereerd.

description
String

De beschrijving van de parameter.

hasDefaultValue
Boolean

true als de parameter optioneel is; anders, false.

defaultValue
Object

De standaardwaarde van de optionele parameter, indien van toepassing.

serializerOptions
JsonSerializerOptions

De opties die worden gebruikt om het schema uit het opgegeven type te extraheren.

inferenceOptions
AIJsonSchemaCreateOptions

De opties voor het maken van schema's.

Retouren

Een JsonElement vertegenwoordiging van het schema.

Opmerkingen

Maakt gebruik van een cache die is opgegeven voor het serializerOptions opslaan van het schemaresultaat, tenzij er een TransformSchemaNode gemachtigde is opgegeven.

Van toepassing op