73 instantiations of UriContent
Microsoft.Extensions.AI.Abstractions.Tests (40)
Contents\UriContentTests.cs (25)
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<ArgumentException>("mediaType", () => new UriContent("data:image/png;base64,aGVsbG8=", ""));
20Assert.Throws<ArgumentException>("mediaType", () => new UriContent("data:image/png;base64,aGVsbG8=", "image"));
22Assert.Throws<ArgumentException>("mediaType", () => new UriContent(new Uri("data:image/png;base64,aGVsbG8="), ""));
23Assert.Throws<ArgumentException>("mediaType", () => new UriContent(new Uri("data:image/png;base64,aGVsbG8="), "audio"));
25UriContent c = new("http://localhost/something", "image/png");
38Assert.Throws<ArgumentException>("mediaType", () => new UriContent("http://localhost/something", type));
40UriContent c = new("http://localhost/something", "image/png");
52var content = new UriContent("http://localhost/something", mediaType);
76var content = new UriContent(uri);
79var content2 = new UriContent(uri, null);
93var content = new UriContent(new Uri(uri));
96var content2 = new UriContent(new Uri(uri), null);
112var content = new UriContent(new Uri(uri, UriKind.Relative));
115var content2 = new UriContent(new Uri(uri, UriKind.Relative), null);
127var content = new UriContent(uri);
140var content = new UriContent(new Uri(uri, UriKind.Relative));
147var content = new UriContent("http://localhost/image.png", "application/octet-stream");
150var relContent = new UriContent(new Uri("image.png", UriKind.Relative), "application/octet-stream");
160new UriContent("http://localhost/something", "image/png"),
191UriContent c = new("http://localhost", mediaType);
204var content = new UriContent("http://localhost", mediaType);
217var content = new UriContent("http://localhost", mediaType);
Contents\WebSearchToolResultContentTests.cs (7)
33new UriContent(new Uri("https://example.com/1"), "text/html") { AdditionalProperties = new() { ["title"] = "Result 1" } }
56new UriContent(new Uri("https://example.com/1"), "text/html") { AdditionalProperties = new() { ["title"] = "First" } },
57new UriContent(new Uri("https://example.com/2"), "text/html") { AdditionalProperties = new() { ["title"] = "Second" } },
58new UriContent(new Uri("https://example.com/3"), "text/html"),
82new UriContent(new Uri("https://example.com"), "text/html") { AdditionalProperties = new() { ["title"] = "Example Page" } },
83new UriContent(new Uri("https://another.com"), "text/html"),
110new UriContent(new Uri("https://test.com"), "text/html") { AdditionalProperties = new() { ["title"] = "Test" } },
Microsoft.Extensions.AI.Evaluation.Integration.Tests (4)
Microsoft.Extensions.AI.OpenAI (5)
Microsoft.Extensions.AI.OpenAI.Tests (6)
OpenAIResponseClientTests.cs (5)
5105new FunctionResultContent("call_uri", new UriContent(new Uri("https://example.com/image.png"), "image/png"))
5224new UriContent(new Uri("https://example.com/result.png"), "image/png"),
5451new FunctionResultContent("call_file_uri", new UriContent(new Uri("https://example.com/document.pdf"), "application/pdf"))
5677new UriContent(new Uri("https://example.com/image.png"), "image/png"),
5678new UriContent(new Uri("https://example.com/image.png"), "image/png") { AdditionalProperties = new AdditionalPropertiesDictionary { ["detail"] = "high" }},
Microsoft.Extensions.AI.Stabilization.Tests (10)
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\Contents\WebSearchToolResultContentTests.cs (7)
33new UriContent(new Uri("https://example.com/1"), "text/html") { AdditionalProperties = new() { ["title"] = "Result 1" } }
56new UriContent(new Uri("https://example.com/1"), "text/html") { AdditionalProperties = new() { ["title"] = "First" } },
57new UriContent(new Uri("https://example.com/2"), "text/html") { AdditionalProperties = new() { ["title"] = "Second" } },
58new UriContent(new Uri("https://example.com/3"), "text/html"),
82new UriContent(new Uri("https://example.com"), "text/html") { AdditionalProperties = new() { ["title"] = "Example Page" } },
83new UriContent(new Uri("https://another.com"), "text/html"),
110new UriContent(new Uri("https://test.com"), "text/html") { AdditionalProperties = new() { ["title"] = "Test" } },
Microsoft.Extensions.AI.Tests (8)
98 references to UriContent
Microsoft.Extensions.AI (2)
Microsoft.Extensions.AI.Abstractions (8)
Microsoft.Extensions.AI.Abstractions.Tests (45)
Contents\UriContentTests.cs (18)
25UriContent c = new("http://localhost/something", "image/png");
40UriContent c = new("http://localhost/something", "image/png");
52var content = new UriContent("http://localhost/something", mediaType);
76var content = new UriContent(uri);
79var content2 = new UriContent(uri, null);
93var content = new UriContent(new Uri(uri));
96var content2 = new UriContent(new Uri(uri), null);
112var content = new UriContent(new Uri(uri, UriKind.Relative));
115var content2 = new UriContent(new Uri(uri, UriKind.Relative), null);
127var content = new UriContent(uri);
140var content = new UriContent(new Uri(uri, UriKind.Relative));
147var content = new UriContent("http://localhost/image.png", "application/octet-stream");
150var relContent = new UriContent(new Uri("image.png", UriKind.Relative), "application/octet-stream");
191UriContent c = new("http://localhost", mediaType);
204var content = new UriContent("http://localhost", mediaType);
217var content = new UriContent("http://localhost", mediaType);
238var uriContent = Assert.IsType<UriContent>(result);
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 (12)
Microsoft.Extensions.AI.Stabilization.Tests (20)