AIJsonUtilities.AddAIContentType Metod

Definition

Överlagringar

Name Description
AddAIContentType(JsonSerializerOptions, Type, String)

Lägger till en anpassad innehållstyp i den polymorfa konfigurationen för AIContent.

AddAIContentType<TContent>(JsonSerializerOptions, String)

Lägger till en anpassad innehållstyp i den polymorfa konfigurationen för AIContent.

AddAIContentType(JsonSerializerOptions, Type, String)

Källa:
AIJsonUtilities.cs

Lägger till en anpassad innehållstyp i den polymorfa konfigurationen för AIContent.

public:
[System::Runtime::CompilerServices::Extension]
 static void AddAIContentType(System::Text::Json::JsonSerializerOptions ^ options, Type ^ contentType, System::String ^ typeDiscriminatorId);
public static void AddAIContentType(this System.Text.Json.JsonSerializerOptions options, Type contentType, string typeDiscriminatorId);
static member AddAIContentType : System.Text.Json.JsonSerializerOptions * Type * string -> unit
<Extension()>
Public Sub AddAIContentType (options As JsonSerializerOptions, contentType As Type, typeDiscriminatorId As String)

Parametrar

options
JsonSerializerOptions

Alternativinstansen som ska konfigureras.

contentType
Type

Den anpassade innehållstyp som ska konfigureras.

typeDiscriminatorId
String

Typdiskriminator-ID för innehållstypen.

Undantag

options, contentType, eller typeDiscriminatorId är null.

contentType är en inbyggd innehållstyp eller inte härleds från AIContent.

options är en skrivskyddad instans.

Gäller för

AddAIContentType<TContent>(JsonSerializerOptions, String)

Källa:
AIJsonUtilities.cs

Lägger till en anpassad innehållstyp i den polymorfa konfigurationen för AIContent.

public:
generic <typename TContent>
 where TContent : Microsoft::Extensions::AI::AIContent[System::Runtime::CompilerServices::Extension]
 static void AddAIContentType(System::Text::Json::JsonSerializerOptions ^ options, System::String ^ typeDiscriminatorId);
public static void AddAIContentType<TContent>(this System.Text.Json.JsonSerializerOptions options, string typeDiscriminatorId) where TContent : Microsoft.Extensions.AI.AIContent;
static member AddAIContentType : System.Text.Json.JsonSerializerOptions * string -> unit (requires 'Content :> Microsoft.Extensions.AI.AIContent)
<Extension()>
Public Sub AddAIContentType(Of TContent As AIContent) (options As JsonSerializerOptions, typeDiscriminatorId As String)

Typparametrar

TContent

Den anpassade innehållstyp som ska konfigureras.

Parametrar

options
JsonSerializerOptions

Alternativinstansen som ska konfigureras.

typeDiscriminatorId
String

Typdiskriminator-ID för innehållstypen.

Undantag

options eller typeDiscriminatorId är null.

TContent är en inbyggd innehållstyp.

options är en skrivskyddad instans.

Gäller för