13 references to AddAIContentType
Microsoft.Extensions.AI.Abstractions.Tests (13)
Utilities\AIJsonUtilitiesTests.cs (13)
1238
options.
AddAIContentType
<DerivedAIContent>("derivativeContent");
1251
Assert.Throws<InvalidOperationException>(() => AIJsonUtilities.DefaultOptions.
AddAIContentType
<DerivedAIContent>("derivativeContent"));
1267
Assert.Throws<ArgumentException>("contentType", () => options.
AddAIContentType
<AIContent>("discriminator"));
1268
Assert.Throws<ArgumentException>("contentType", () => options.
AddAIContentType
<TextContent>("discriminator"));
1278
options.
AddAIContentType
<DerivedAIContent>("text");
1279
options.
AddAIContentType
<DerivedAIContent>("audio");
1289
Assert.Throws<ArgumentNullException>("options", () => ((JsonSerializerOptions)null!).
AddAIContentType
<DerivedAIContent>("discriminator"));
1291
Assert.Throws<ArgumentNullException>("typeDiscriminatorId", () => options.
AddAIContentType
<DerivedAIContent>(null!));
1308
options.
AddAIContentType
<LeafContent>("leaf");
1360
options.
AddAIContentType
<DerivedToolCallContent>("derivedToolCall");
1403
options.
AddAIContentType
<DerivedAIContent>("derived");
1404
options.
AddAIContentType
<LeafContent>("leaf");
1450
options.
AddAIContentType
<LeafContent>("leaf");