86 references to HostedFileContent
Microsoft.Extensions.AI.Abstractions.Tests (34)
Contents\AIContentTests.cs (1)
74new HostedFileContent("file123"),
Contents\CodeInterpreterToolCallContentTests.cs (2)
53new HostedFileContent("file123"), 73new HostedFileContent("file456")
Contents\CodeInterpreterToolResultContentTests.cs (2)
53new HostedFileContent("output.png"), 75new HostedFileContent("result.txt")
Contents\HostedFileContentTests.cs (17)
15Assert.Throws<ArgumentNullException>("fileId", () => new HostedFileContent(null!)); 16Assert.Throws<ArgumentException>("fileId", () => new HostedFileContent(string.Empty)); 17Assert.Throws<ArgumentException>("fileId", () => new HostedFileContent(" ")); 24HostedFileContent c = new(fileId); 39HostedFileContent c = new("id123"); 63var content = new HostedFileContent("file123"); 75HostedFileContent c = new("id123"); 97HostedFileContent c = new("id123"); 109HostedFileContent c = new("id123") { MediaType = mediaType }; 116HostedFileContent c = new("id123"); 132HostedFileContent c = new("id123"); 145HostedFileContent c = new("id123"); 160HostedFileContent c = new("id123"); 173HostedFileContent c = new("id123"); 188var content = new HostedFileContent("file123") 226HostedFileContent c = new("id123") { MediaType = mediaType }; 233HostedFileContent c = new("id123");
Files\DelegatingHostedFileClientTests.cs (4)
32var expectedFile = new HostedFileContent("file-123"); 88var expectedFile = new HostedFileContent("file-789") { Name = "info.txt" }; 115new HostedFileContent("file-1"), 116new HostedFileContent("file-2")
Files\HostedFileClientExtensionsTests.cs (6)
31return Task.FromResult(new HostedFileContent("file-1")); 82return new HostedFileContent("file-2"); 289var hostedFileContent = new HostedFileContent("file-hfc"); 308var content = new HostedFileContent("file-1"); 322var hostedFileContent = new HostedFileContent("file-scoped") { Scope = "container-42" }; 341var hostedFileContent = new HostedFileContent("file-scoped") { Scope = "container-from-content" };
Tools\HostedCodeInterpreterToolTests.cs (1)
47new HostedFileContent("id123"),
Tools\HostedFileSearchToolTests.cs (1)
49new HostedFileContent("id456"),
Microsoft.Extensions.AI.OpenAI (6)
OpenAIChatClient.cs (1)
811contentPart.FileId is not null ? new HostedFileContent(contentPart.FileId) { Name = contentPart.Filename } :
OpenAIHostedFileClient.cs (2)
328new(openAIFile.Id) 347return new HostedFileContent(file.Id)
OpenAIResponsesChatClient.cs (3)
1701content = new HostedFileContent(part.InputImageFileId) { MediaType = "image/*" }; 1705content = new HostedFileContent(part.InputFileId) { Name = part.InputFilename }; 1957var hfc = new HostedFileContent(fileId) { MediaType = mimeType, RawRepresentation = output };
Microsoft.Extensions.AI.OpenAI.Tests (6)
OpenAIConversionTests.cs (1)
351var fileContent = new HostedFileContent("file-123");
OpenAIResponseClientTests.cs (5)
5056new FunctionResultContent("call_file", new HostedFileContent("file-abc123") { MediaType = "image/png", Name = "result.png" }) 5402new FunctionResultContent("call_hosted_file", new HostedFileContent("file-xyz789") { MediaType = "text/plain", Name = "document.txt" }) 5576new HostedFileContent("file-img-456") { MediaType = "image/png" }, 5577new HostedFileContent("file-img-789") { MediaType = "image/jpeg", AdditionalProperties = new AdditionalPropertiesDictionary { ["detail"] = "high" }}, 5578new HostedFileContent("file-123"),
Microsoft.Extensions.AI.Stabilization.Tests (22)
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\Contents\CodeInterpreterToolCallContentTests.cs (2)
53new HostedFileContent("file123"), 73new HostedFileContent("file456")
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\Contents\CodeInterpreterToolResultContentTests.cs (2)
53new HostedFileContent("output.png"), 75new HostedFileContent("result.txt")
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\Contents\HostedFileContentTests.cs (17)
15Assert.Throws<ArgumentNullException>("fileId", () => new HostedFileContent(null!)); 16Assert.Throws<ArgumentException>("fileId", () => new HostedFileContent(string.Empty)); 17Assert.Throws<ArgumentException>("fileId", () => new HostedFileContent(" ")); 24HostedFileContent c = new(fileId); 39HostedFileContent c = new("id123"); 63var content = new HostedFileContent("file123"); 75HostedFileContent c = new("id123"); 97HostedFileContent c = new("id123"); 109HostedFileContent c = new("id123") { MediaType = mediaType }; 116HostedFileContent c = new("id123"); 132HostedFileContent c = new("id123"); 145HostedFileContent c = new("id123"); 160HostedFileContent c = new("id123"); 173HostedFileContent c = new("id123"); 188var content = new HostedFileContent("file123") 226HostedFileContent c = new("id123") { MediaType = mediaType }; 233HostedFileContent c = new("id123");
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\Tools\HostedCodeInterpreterToolTests.cs (1)
47new HostedFileContent("id123"),
Microsoft.Extensions.AI.Tests (18)
ChatCompletion\OpenTelemetryChatClientTests.cs (3)
412new HostedFileContent("file-abc123"), 428yield return new() { Contents = [new HostedFileContent("file-abc123")] }; 448new HostedFileContent("file-xyz789"),
Files\LoggingHostedFileClientTests.cs (5)
61Task.FromResult(new HostedFileContent("file-123") { Name = "test.txt" }), 170Task.FromResult<HostedFileContent?>(new HostedFileContent("file-456") { Name = "report.pdf" }), 233yield return new HostedFileContent("file-1") { Name = "a.txt" }; 234yield return new HostedFileContent("file-2") { Name = "b.txt" }; 510yield return new HostedFileContent("file-1");
Files\OpenTelemetryHostedFileClientTests.cs (10)
41Task.FromResult(new HostedFileContent("file-abc") { Name = "test.txt", SizeInBytes = 1024 }), 134Task.FromResult<HostedFileContent?>(new HostedFileContent("file-info") { Name = "report.pdf", SizeInBytes = 2048 }), 188yield return new HostedFileContent("file-1") { Name = "a.txt" }; 189yield return new HostedFileContent("file-2") { Name = "b.txt" }; 190yield return new HostedFileContent("file-3") { Name = "c.txt" }; 312yield return new HostedFileContent("file-1"); 367Task.FromResult(new HostedFileContent("file-1")), 499Task.FromResult(new HostedFileContent("file-1")), 537Task.FromResult(new HostedFileContent("file-1")), 574Task.FromResult(new HostedFileContent("file-1")),