25 references to DataContent
Microsoft.Extensions.AI.Abstractions (1)
Image\ImageGeneratorExtensions.cs (1)
195var dataContent = new DataContent(originalImageData, mediaType) { Name = fileName };
Microsoft.Extensions.AI.Abstractions.Tests (15)
ChatCompletion\ChatMessageTests.cs (1)
264new DataContent(new BinaryData(new[] { 1, 2, 3 }, options: TestJsonSerializerContext.Default.Options), "mime-type/3")
ChatCompletion\ChatResponseUpdateTests.cs (1)
124new DataContent("data"u8.ToArray(), "text/plain"),
Contents\DataContentTests.cs (5)
84content = new DataContent(new byte[] { 0, 1, 2 }, mediaType); 121new DataContent(new ReadOnlyMemory<byte>([0x01, 0x02, 0x03, 0x04]), "application/octet-stream"), 127new DataContent(new ReadOnlyMemory<byte>([0x01, 0x02, 0x03, 0x04]), "application/octet-stream") { Name = "test.bin" }, 255var content = new DataContent(data, "application/octet-stream"); 274DataContent content = new(new byte[] { 1, 2, 3 }, "application/octet-stream");
HostedCodeInterpreterToolTests.cs (1)
29new DataContent(new byte[] { 1, 2, 3 }, "application/octet-stream")
Image\ImageGenerationResponseTests.cs (3)
74new DataContent(imageData, "image/jpeg") 100new DataContent((byte[])[1, 2, 3, 4], "image/jpeg") 138new DataContent((byte[])[255, 216, 255, 224], "image/jpeg"),
Image\ImageGeneratorExtensionsTests.cs (3)
64var dataContent = new DataContent(imageData, "image/png") { Name = "test.png" }; 92var dataContent = new DataContent(new byte[] { 1, 2, 3 }, "image/png"); 202var dataContent = new DataContent(imageData, "image/png");
Image\ImageGeneratorTests.cs (1)
140AIContent[] originalImages = [new DataContent((byte[])[1, 2, 3, 4], "image/png")];
Microsoft.Extensions.AI.Integration.Tests (1)
ImageGeneratorIntegrationTests.cs (1)
86AIContent[] originalImages = [new DataContent(imageData, "image/png") { Name = "dotnet.png" }];
Microsoft.Extensions.AI.OpenAI (6)
OpenAIChatClient.cs (4)
350responseUpdate.Contents.Add(new DataContent(audioUpdate.AudioBytesUpdate.ToMemory(), GetOutputAudioMimeType(options)) 468returnMessage.Contents.Add(new DataContent(audio.AudioBytes.ToMemory(), GetOutputAudioMimeType(chatCompletionOptions)) 689contentPart.ImageBytes is not null ? new DataContent(contentPart.ImageBytes.ToMemory(), contentPart.ImageBytesMediaType) : 702contentPart.FileBytes is not null ? new DataContent(contentPart.FileBytes.ToMemory(), contentPart.FileBytesMediaType) { Name = contentPart.Filename } :
OpenAIImageGenerator.cs (1)
163contents.Add(new DataContent(image.ImageBytes.ToMemory(), contentType));
OpenAIResponsesChatClient.cs (1)
645results.Add(new DataContent(part.InputFileBytes, part.InputFileBytesMediaType ?? "application/octet-stream")
Microsoft.Extensions.AI.OpenAI.Tests (1)
OpenAIConversionTests.cs (1)
401new DataContent(new byte[] { 1, 2, 3, 4 }, "application/octet-stream")
Microsoft.Extensions.AI.Tests (1)
Image\LoggingImageGeneratorTests.cs (1)
117AIContent[] originalImages = [new DataContent((byte[])[1, 2, 3, 4], "image/png")];