13 instantiations of ImageContent
Microsoft.Extensions.AI.Abstractions.Tests (9)
ChatCompletion\ChatCompletionTests.cs (1)
242new ImageContent("http://localhost/image.png"),
ChatCompletion\ChatMessageTests.cs (4)
128new ImageContent("http://localhost/image"), 167new ImageContent("http://localhost/image"), 268new ImageContent(new Uri("https://fake-random-test-host:123"), "mime-type/2") 280new ImageContent(new BinaryData(new[] { 2, 1, 3 }, options: TestJsonSerializerContext.Default.Options), "mime-type/5")
ChatCompletion\StreamingChatCompletionUpdateExtensionsTests.cs (1)
174updates.Add(new() { Contents = [new ImageContent("https://uri")] });
ChatCompletion\StreamingChatCompletionUpdateTests.cs (3)
95new ImageContent("http://localhost/image"), 140new ImageContent("http://localhost/image"), 172new ImageContent("http://localhost/image"),
Microsoft.Extensions.AI.Integration.Tests (1)
ChatClientIntegrationTests.cs (1)
150new ImageContent(GetImageDataUri()),
Microsoft.Extensions.AI.OpenAI (2)
OpenAIChatClient.cs (2)
553contentPart.ImageUri is not null ? new ImageContent(contentPart.ImageUri, contentPart.ImageBytesMediaType) : 554contentPart.ImageBytes is not null ? new ImageContent(contentPart.ImageBytes.ToMemory(), contentPart.ImageBytesMediaType) :
Microsoft.Extensions.AI.Tests (1)
ChatCompletion\ChatClientStructuredOutputExtensionsTests.cs (1)
151var expectedCompletion = new ChatCompletion([new ChatMessage(ChatRole.Assistant, [new ImageContent("https://example.com")])]);
18 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 (7)
ChatCompletion\ChatCompletionTests.cs (1)
278Assert.IsType<ImageContent>(update0.Contents[1]);
ChatCompletion\ChatMessageTests.cs (3)
319var imageContent = deserializedMessage.Contents[1] as ImageContent; 343imageContent = 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 (2)
AzureAIInferenceChatClient.cs (2)
481case ImageContent imageContent when imageContent.Data is { IsEmpty: false } data: 485case ImageContent imageContent when imageContent.Uri is string uri:
Microsoft.Extensions.AI.Ollama (2)
OllamaChatClient.cs (2)
356if (currentTextMessage is not null && item is not ImageContent) 372case ImageContent imageContent when imageContent.Data is not null:
Microsoft.Extensions.AI.OpenAI (3)
OpenAIChatClient.cs (3)
551ImageContent? imageContent; 657case ImageContent imageContent when imageContent.Data is { IsEmpty: false } data: 661case ImageContent imageContent when imageContent.Uri is string uri: