11 references to UriContent
Microsoft.Extensions.AI.Abstractions (1)
Contents\UriContent.cs (1)
40
:
this
(new Uri(Throw.IfNull(uri)), mediaType)
Microsoft.Extensions.AI.Abstractions.Tests (8)
Contents\UriContentTests.cs (4)
16
Assert.Throws<ArgumentNullException>("uri", () => new
UriContent
((Uri)null!, "image/png"));
23
Assert.Throws<ArgumentNullException>("mediaType", () => new
UriContent
(new Uri("data:image/png;base64,aGVsbG8="), null!));
24
Assert.Throws<ArgumentException>("mediaType", () => new
UriContent
(new Uri("data:image/png;base64,aGVsbG8="), ""));
25
Assert.Throws<ArgumentException>("mediaType", () => new
UriContent
(new Uri("data:image/png;base64,aGVsbG8="), "audio"));
Image\ImageGenerationResponseTests.cs (4)
33
content.Add(new
UriContent
(new Uri($"https://example.com/image-{i}.png"), "image/png"));
73
new
UriContent
(new Uri("https://example.com/image1.png"), "image/png"),
99
new
UriContent
(new Uri("https://example.com/image1.png"), "image/png"),
137
new
UriContent
(new Uri("https://example.com/image.png"), "image/png"),
Microsoft.Extensions.AI.OpenAI (2)
OpenAIChatClient.cs (1)
688
contentPart.ImageUri is not null ? new
UriContent
(contentPart.ImageUri, "image/*") :
OpenAIImageGenerator.cs (1)
167
contents.Add(new
UriContent
(image.ImageUri, contentType));