10 instantiations of ImageContent
Microsoft.Extensions.AI.Abstractions.Tests (7)
ChatCompletion\ChatMessageTests.cs (4)
127new ImageContent("http://localhost/image"), 166new ImageContent("http://localhost/image"), 268new ImageContent(new Uri("https://fake-random-test-host:123"), "mime-type/2") 283new ImageContent(new BinaryData(new[] { 2, 1, 3 }, options: TestJsonSerializerContext.Default.Options), "mime-type/5")
ChatCompletion\StreamingChatCompletionUpdateTests.cs (3)
95new ImageContent("http://localhost/image"), 140new ImageContent("http://localhost/image"), 172new ImageContent("http://localhost/image"),
Microsoft.Extensions.AI.OpenAI (2)
OpenAIChatClient.cs (2)
550contentPart.ImageUri is not null ? new ImageContent(contentPart.ImageUri, contentPart.ImageBytesMediaType) : 551contentPart.ImageBytes is not null ? new ImageContent(contentPart.ImageBytes.ToMemory(), contentPart.ImageBytesMediaType) :
Microsoft.Extensions.AI.Tests (1)
ChatCompletion\ChatClientStructuredOutputExtensionsTests.cs (1)
117var expectedCompletion = new ChatCompletion([new ChatMessage(ChatRole.Assistant, [new ImageContent("https://example.com")])]);
15 references to ImageContent
Microsoft.Extensions.AI.Abstractions (4)
Contents\AIContent.cs (1)
14[JsonDerivedType(typeof(ImageContent), typeDiscriminator: "image")]
Contents\ImageContent.cs (3)
16/// Initializes a new instance of the <see cref="ImageContent"/> class. 26/// Initializes a new instance of the <see cref="ImageContent"/> class. 37/// Initializes a new instance of the <see cref="ImageContent"/> class.
Microsoft.Extensions.AI.Abstractions.Tests (6)
ChatCompletion\ChatMessageTests.cs (3)
325var imageContent = deserializedMessage.Contents[1] as ImageContent; 352imageContent = deserializedMessage.Contents[4] as ImageContent;
ChatCompletion\StreamingChatCompletionUpdateTests.cs (2)
195Assert.IsType<ImageContent>(result.Contents[1]); 196Assert.Equal("http://localhost/image", ((ImageContent)result.Contents[1]).Uri);
Contents\ImageContentTests.cs (1)
6public sealed class ImageContentTests : DataContentTests<ImageContent>;
Microsoft.Extensions.AI.AzureAIInference (1)
AzureAIInferenceChatClient.cs (1)
456ImageContent imageContent => imageContent.Data is { IsEmpty: false } data ? new ChatMessageImageContentItem(BinaryData.FromBytes(data), imageContent.MediaType) :
Microsoft.Extensions.AI.Ollama (2)
OllamaChatClient.cs (2)
324if (currentTextMessage is not null && item is not ImageContent) 340case ImageContent imageContent when imageContent.Data is not null:
Microsoft.Extensions.AI.OpenAI (2)
OpenAIChatClient.cs (2)
548ImageContent? imageContent; 616ImageContent imageContent => imageContent.Data is { IsEmpty: false } data ? ChatMessageContentPart.CreateImagePart(BinaryData.FromBytes(data), imageContent.MediaType) :