Compartir a través de


AIJsonUtilities.AddAIContentType Method

Definition

Overloads

AddAIContentType(JsonSerializerOptions, Type, String)

Adds a custom content type to the polymorphic configuration for AIContent.

AddAIContentType<TContent>(JsonSerializerOptions, String)

Adds a custom content type to the polymorphic configuration for AIContent.

AddAIContentType(JsonSerializerOptions, Type, String)

Adds a custom content type to the polymorphic configuration for 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)

Parameters

options
JsonSerializerOptions

The options instance to configure.

contentType
Type

The custom content type to configure.

typeDiscriminatorId
String

The type discriminator id for the content type.

Exceptions

options, contentType, or typeDiscriminatorId is null.

contentType is a built-in content type or does not derived from AIContent.

options is a read-only instance.

Applies to

AddAIContentType<TContent>(JsonSerializerOptions, String)

Adds a custom content type to the polymorphic configuration for 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)

Type Parameters

TContent

The custom content type to configure.

Parameters

options
JsonSerializerOptions

The options instance to configure.

typeDiscriminatorId
String

The type discriminator id for the content type.

Exceptions

options or typeDiscriminatorId is null.

TContent is a built-in content type.

options is a read-only instance.

Applies to