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