47 instantiations of UriContent
Microsoft.Extensions.AI.Abstractions.Tests (25)
Contents\UriContentTests.cs (17)
15Assert.Throws<ArgumentNullException>("uri", () => new UriContent((string)null!, "image/png"));
16Assert.Throws<ArgumentNullException>("uri", () => new UriContent((Uri)null!, "image/png"));
17Assert.Throws<UriFormatException>(() => new UriContent("notauri", "image/png"));
19Assert.Throws<ArgumentNullException>("mediaType", () => new UriContent("data:image/png;base64,aGVsbG8=", null!));
20Assert.Throws<ArgumentException>("mediaType", () => new UriContent("data:image/png;base64,aGVsbG8=", ""));
21Assert.Throws<ArgumentException>("mediaType", () => new UriContent("data:image/png;base64,aGVsbG8=", "image"));
23Assert.Throws<ArgumentNullException>("mediaType", () => new UriContent(new Uri("data:image/png;base64,aGVsbG8="), null!));
24Assert.Throws<ArgumentException>("mediaType", () => new UriContent(new Uri("data:image/png;base64,aGVsbG8="), ""));
25Assert.Throws<ArgumentException>("mediaType", () => new UriContent(new Uri("data:image/png;base64,aGVsbG8="), "audio"));
27UriContent c = new("http://localhost/something", "image/png");
40Assert.Throws<ArgumentException>("mediaType", () => new UriContent("http://localhost/something", type));
42UriContent c = new("http://localhost/something", "image/png");
54var content = new UriContent("http://localhost/something", mediaType);
70new UriContent("http://localhost/something", "image/png"),
101UriContent c = new("http://localhost", mediaType);
114var content = new UriContent("http://localhost", mediaType);
127var content = new UriContent("http://localhost", mediaType);
Microsoft.Extensions.AI.Evaluation.Integration.Tests (4)
Microsoft.Extensions.AI.OpenAI (4)
Microsoft.Extensions.AI.OpenAI.Tests (6)
OpenAIResponseClientTests.cs (5)
4367new FunctionResultContent("call_uri", new UriContent(new Uri("https://example.com/image.png"), "image/png"))
4486new UriContent(new Uri("https://example.com/result.png"), "image/png"),
4713new FunctionResultContent("call_file_uri", new UriContent(new Uri("https://example.com/document.pdf"), "application/pdf"))
4937new UriContent(new Uri("https://example.com/image.png"), "image/png"),
4938new UriContent(new Uri("https://example.com/image.png"), "image/png") { AdditionalProperties = new AdditionalPropertiesDictionary { ["detail"] = "high" }},
Microsoft.Extensions.AI.Tests (8)
ChatCompletion\OpenTelemetryChatClientTests.cs (5)
363new UriContent(new Uri("https://example.com/image.jpg"), "image/jpeg"),
379yield return new() { Contents = [new UriContent(new Uri("https://example.com/image.jpg"), "image/jpeg")] };
399new UriContent(new Uri("https://example.com/video.mp4"), "video/mp4"),
616new ImageGenerationToolResultContent { ImageId = "img-123", Outputs = [new UriContent(new Uri("https://example.com/image.png"), "image/png")] },
632yield return new() { Contents = [new ImageGenerationToolResultContent { ImageId = "img-123", Outputs = [new UriContent(new Uri("https://example.com/image.png"), "image/png")] }] };
37 references to UriContent
Microsoft.Extensions.AI (1)
Microsoft.Extensions.AI.Abstractions (6)
Microsoft.Extensions.AI.Abstractions.Tests (15)
Microsoft.Extensions.AI.Evaluation (1)
Microsoft.Extensions.AI.Evaluation.Safety (4)
Microsoft.Extensions.AI.Integration.Tests (1)
Microsoft.Extensions.AI.OpenAI (5)
Microsoft.Extensions.AI.OpenAI.Tests (4)