18 references to Data
Microsoft.Extensions.AI.Abstractions (2)
Contents\DataContent.cs (2)
132Debug.Assert(Data is not null, "Expected Data to be initialized."); 133_uri = string.Concat("data:", MediaType, ";base64,", Convert.ToBase64String(Data.GetValueOrDefault()
Microsoft.Extensions.AI.Abstractions.Tests (12)
ChatCompletion\ChatMessageTests.cs (3)
329Assert.True(dataContent.Data!.Value.Span.SequenceEqual(new BinaryData(new[] { 1, 2, 3 }, TestJsonSerializerContext.Default.Options))); 337Assert.True(audioContent.Data!.Value.Span.SequenceEqual(new BinaryData(new[] { 3, 2, 1 }, TestJsonSerializerContext.Default.Options))); 345Assert.True(imageContent.Data?.Span.SequenceEqual(new BinaryData(new[] { 2, 1, 3 }, TestJsonSerializerContext.Default.Options)));
ChatCompletion\StreamingChatCompletionUpdateTests.cs (1)
202Assert.Equal("data"u8.ToArray(), ((DataContent)result.Contents[3]).Data?.ToArray());
Contents\DataContentTests{T}.cs (8)
112Assert.Null(content.Data); 118Assert.Equal("something"u8.ToArray(), content.Data!.Value.ToArray()); 123Assert.Equal("Hello <>"u8.ToArray(), content.Data!.Value.ToArray()); 164Assert.NotNull(content.Data); 165Assert.Equal([0x01, 0x02, 0x03, 0x04], content.Data!.Value.ToArray()); 172Assert.Null(content.Data); 191Assert.NotNull(content.Data); 192Assert.Equal([0x01, 0x02, 0x03, 0x04], content.Data!.Value.ToArray());
Microsoft.Extensions.AI.AzureAIInference (1)
AzureAIInferenceChatClient.cs (1)
481case ImageContent imageContent when imageContent.Data is { IsEmpty: false } data:
Microsoft.Extensions.AI.Ollama (2)
OllamaChatClient.cs (2)
372case ImageContent imageContent when imageContent.Data is not null: 374images.Add(Convert.ToBase64String(imageContent.Data.Value
Microsoft.Extensions.AI.OpenAI (1)
OpenAIChatClient.cs (1)
657case ImageContent imageContent when imageContent.Data is { IsEmpty: false } data: