25 instantiations of HostedFileContent
Microsoft.Extensions.AI.Abstractions.Tests (17)
Contents\AIContentTests.cs (1)
70new HostedFileContent("file123"),
Contents\CodeInterpreterToolCallContentTests.cs (2)
56new HostedFileContent("file123"), 77new HostedFileContent("file456")
Contents\CodeInterpreterToolResultContentTests.cs (2)
56new HostedFileContent("output.png"), 79new HostedFileContent("result.txt")
Contents\HostedFileContentTests.cs (10)
15Assert.Throws<ArgumentNullException>(() => new HostedFileContent(null!)); 16Assert.Throws<ArgumentException>(() => new HostedFileContent(string.Empty)); 17Assert.Throws<ArgumentException>(() => new HostedFileContent(" ")); 24HostedFileContent c = new(fileId); 33HostedFileContent c = new("id123"); 57var content = new HostedFileContent("file123"); 69HostedFileContent c = new("id123"); 91HostedFileContent c = new("id123"); 103HostedFileContent c = new("id123") { MediaType = mediaType }; 110HostedFileContent c = new("id123");
Tools\HostedCodeInterpreterToolTests.cs (1)
28new HostedFileContent("id123"),
Tools\HostedFileSearchToolTests.cs (1)
30new HostedFileContent("id456"),
Microsoft.Extensions.AI.OpenAI (4)
OpenAIAssistantsChatClient.cs (1)
231(hcitrc.Outputs ??= []).Add(new HostedFileContent(output.ImageFileId) { MediaType = "image/*" });
OpenAIChatClient.cs (1)
724contentPart.FileId is not null ? new HostedFileContent(contentPart.FileId) { Name = contentPart.Filename } :
OpenAIResponsesChatClient.cs (2)
1023results.Add(new HostedFileContent(part.InputImageFileId) { MediaType = "image/*", RawRepresentation = part }); 1027results.Add(new HostedFileContent(part.InputFileId) { Name = part.InputFilename, RawRepresentation = part });
Microsoft.Extensions.AI.OpenAI.Tests (1)
OpenAIConversionTests.cs (1)
224var fileContent = new HostedFileContent("file-123");
Microsoft.Extensions.AI.Tests (3)
ChatCompletion\OpenTelemetryChatClientTests.cs (3)
361new HostedFileContent("file-abc123"), 377yield return new() { Contents = [new HostedFileContent("file-abc123")] }; 397new HostedFileContent("file-xyz789"),
30 references to HostedFileContent
Microsoft.Extensions.AI (1)
ChatCompletion\OpenTelemetryChatClient.cs (1)
296case HostedFileContent fc:
Microsoft.Extensions.AI.Abstractions (7)
Contents\AIContent.cs (1)
15[JsonDerivedType(typeof(HostedFileContent), typeDiscriminator: "hostedFile")]
Contents\CodeInterpreterToolCallContent.cs (1)
35/// Inputs can include various types of content such as <see cref="HostedFileContent"/> for files,
Contents\CodeInterpreterToolResultContent.cs (1)
31/// Outputs can include various types of content such as <see cref="HostedFileContent"/> for files,
Contents\HostedFileContent.cs (1)
21/// Initializes a new instance of the <see cref="HostedFileContent"/> class.
Contents\HostedVectorStoreContent.cs (1)
14/// Unlike <see cref="HostedFileContent"/> which represents a specific file that is hosted by the AI service,
Tools\HostedCodeInterpreterTool.cs (1)
26/// represented via <see cref="HostedFileContent"/>. Some also support binary data, represented via <see cref="DataContent"/>.
Tools\HostedFileSearchTool.cs (1)
26/// support different kinds of inputs, for example, some might respect <see cref="HostedFileContent"/> using provider-specific file IDs,
Microsoft.Extensions.AI.Abstractions.Tests (17)
Contents\CodeInterpreterToolCallContentTests.cs (3)
64Assert.IsType<HostedFileContent>(c.Inputs[1]); 90Assert.IsType<HostedFileContent>(deserializedSut.Inputs[1]); 91Assert.Equal("file456", ((HostedFileContent)deserializedSut.Inputs[1]).FileId);
Contents\CodeInterpreterToolResultContentTests.cs (3)
65Assert.IsType<HostedFileContent>(c.Outputs[1]); 92Assert.IsType<HostedFileContent>(deserializedSut.Outputs[1]); 93Assert.Equal("result.txt", ((HostedFileContent)deserializedSut.Outputs[1]).FileId);
Contents\HostedFileContentTests.cs (9)
24HostedFileContent c = new(fileId); 33HostedFileContent c = new("id123"); 57var content = new HostedFileContent("file123"); 60var deserializedContent = JsonSerializer.Deserialize<HostedFileContent>(json, AIJsonUtilities.DefaultOptions); 69HostedFileContent c = new("id123"); 91HostedFileContent c = new("id123"); 103HostedFileContent c = new("id123") { MediaType = mediaType }; 110HostedFileContent c = new("id123");
Tools\HostedCodeInterpreterToolTests.cs (1)
35Assert.IsType<HostedFileContent>(tool.Inputs[0]);
Tools\HostedFileSearchToolTests.cs (1)
39Assert.IsType<HostedFileContent>(tool.Inputs[1]);
Microsoft.Extensions.AI.OpenAI (4)
OpenAIAssistantsChatClient.cs (1)
396if (input is HostedFileContent hostedFile)
OpenAIChatClient.cs (1)
303case HostedFileContent fileContent:
OpenAIResponsesChatClient.cs (2)
494new CodeInterpreterToolContainer(codeTool.Inputs?.OfType<HostedFileContent>().Select(f => f.FileId).ToList() is { Count: > 0 } ids ? 828case HostedFileContent fileContent:
Microsoft.Extensions.AI.OpenAI.Tests (1)
OpenAIConversionTests.cs (1)
224var fileContent = new HostedFileContent("file-123");