2 types derived from DataContent
Microsoft.Extensions.AI.Abstractions (2)
Contents\AudioContent.cs (1)
13public class AudioContent : DataContent
Contents\ImageContent.cs (1)
13public class ImageContent : DataContent
2 instantiations of DataContent
Microsoft.Extensions.AI.Abstractions.Tests (2)
ChatCompletion\ChatMessageTests.cs (1)
272new DataContent(new BinaryData(new[] { 1, 2, 3 }, options: TestJsonSerializerContext.Default.Options), "mime-type/3")
Contents\DataContentTests{T}.cs (1)
245DataContent c = new("data:,", mediaType);
19 references to DataContent
Microsoft.Extensions.AI.Abstractions (5)
Contents\AIContent.cs (1)
11[JsonDerivedType(typeof(DataContent), typeDiscriminator: "data")]
Contents\DataContent.cs (4)
45/// Initializes a new instance of the <see cref="DataContent"/> class. 55/// Initializes a new instance of the <see cref="DataContent"/> class. 96/// Initializes a new instance of the <see cref="DataContent"/> class. 117/// <summary>Gets the URI for this <see cref="DataContent"/>.</summary>
Microsoft.Extensions.AI.Abstractions.Tests (14)
ChatCompletion\ChatMessageTests.cs (2)
327var dataContent = deserializedMessage.Contents[2] as DataContent;
ChatCompletion\StreamingChatCompletionUpdateTests.cs (2)
201Assert.IsType<DataContent>(result.Contents[3]); 202Assert.Equal("data"u8.ToArray(), ((DataContent)result.Contents[3]).Data?.ToArray());
Contents\DataContentTests.cs (1)
6public sealed class DataContentTests : DataContentTests<DataContent>;
Contents\DataContentTests{T}.cs (9)
12where T : DataContent 154Assert.Throws<ArgumentNullException>("uri", () => JsonSerializer.Deserialize<DataContent>(json, TestJsonSerializerContext.Default.Options)!); 161var content = JsonSerializer.Deserialize<DataContent>("""{"mediaType":"application/octet-stream","uri":"data:;base64,AQIDBA=="}""", TestJsonSerializerContext.Default.Options)!; 170content = JsonSerializer.Deserialize<DataContent>("""{"mediaType":"application/octet-stream","uri":"http://localhost/"}""", TestJsonSerializerContext.Default.Options)!; 178content = JsonSerializer.Deserialize<DataContent>(""" 213var content = JsonSerializer.Deserialize<DataContent>(serialized, TestJsonSerializerContext.Default.Options)!; 245DataContent c = new("data:,", mediaType);