2 types derived from HostedFileClientOptions
Microsoft.Extensions.AI.Abstractions.Tests (2)
51 instantiations of HostedFileClientOptions
Microsoft.Extensions.AI.Abstractions (2)
Microsoft.Extensions.AI.Abstractions.Tests (9)
Microsoft.Extensions.AI.OpenAI.Tests (32)
OpenAIHostedFileClientIntegrationTests.cs (15)
40var uploadedFile = await _client!.UploadAsync(uploadStream, "application/jsonl", fileName, new HostedFileClientOptions { Purpose = "fine-tune" });
94var uploadedFile = await _client!.UploadAsync(uploadStream, "text/plain", fileName, new HostedFileClientOptions { Purpose = "assistants" });
98await foreach (var file in _client.ListFilesAsync(new HostedFileClientOptions { Purpose = "assistants" }))
126var uploadedFile = await _client!.UploadAsync(uploadStream, "text/plain", fileName, new HostedFileClientOptions { Purpose = "assistants" });
179var uploadedFile = await _client!.UploadAsync(dataContent, new HostedFileClientOptions { Purpose = "assistants" });
208var uploadedFile = await _client!.UploadAsync(uploadStream, "application/jsonl", fileName, new HostedFileClientOptions { Purpose = "fine-tune" });
238var uploadedFile = await _client!.UploadAsync(uploadStream, "application/jsonl", fileName, new HostedFileClientOptions { Purpose = "fine-tune" });
302new HostedFileClientOptions { Scope = containerId });
310await foreach (var file in containerClient.ListFilesAsync(new HostedFileClientOptions { Scope = containerId }))
318var fileInfo = await containerClient.GetFileInfoAsync(uploadedFile.FileId, new HostedFileClientOptions { Scope = containerId });
323using var downloadStream = await containerClient.DownloadAsync(uploadedFile.FileId, new HostedFileClientOptions { Scope = containerId });
330bool deleted = await containerClient.DeleteAsync(uploadedFile.FileId, new HostedFileClientOptions { Scope = containerId });
368await foreach (var file in fileClient.ListFilesAsync(new HostedFileClientOptions { Scope = containerId }))
377using var downloadStream = await fileClient.DownloadAsync(firstFile, new HostedFileClientOptions { Scope = containerId });
419new HostedFileClientOptions { Scope = containerId });
OpenAIHostedFileClientTests.cs (17)
149var result = await client.UploadAsync(stream, options: new HostedFileClientOptions { Purpose = "fine-tune" });
297var files = await CollectAsync(client.ListFilesAsync(new HostedFileClientOptions { Limit = 2 }));
318var files = await CollectAsync(client.ListFilesAsync(new HostedFileClientOptions { Purpose = "assistants" }));
383() => client.UploadAsync(stream, options: new HostedFileClientOptions { Scope = "container-123" }));
393() => client.DownloadAsync("file-abc123", new HostedFileClientOptions { Scope = "container-123" }));
403() => client.GetFileInfoAsync("file-abc123", new HostedFileClientOptions { Scope = "container-123" }));
413async () => await CollectAsync(client.ListFilesAsync(new HostedFileClientOptions { Scope = "container-123" })));
423() => client.DeleteAsync("file-abc123", new HostedFileClientOptions { Scope = "container-123" }));
662var result = await client.UploadAsync(contentStream, "text/csv", "data.csv", new HostedFileClientOptions { Scope = "ctr-123" });
687await client.UploadAsync(contentStream, "text/csv", "data.csv", new HostedFileClientOptions { Scope = "ctr-123" });
716using var stream = await client.DownloadAsync("cfile-1", new HostedFileClientOptions { Scope = "ctr-123" });
743var result = await client.GetFileInfoAsync("cfile-1", new HostedFileClientOptions { Scope = "ctr-123" });
758var result = await client.GetFileInfoAsync("cfile-nonexistent", new HostedFileClientOptions { Scope = "ctr-123" });
785var files = await CollectAsync(client.ListFilesAsync(new HostedFileClientOptions { Scope = "ctr-123" }));
809var result = await client.DeleteAsync("cfile-1", new HostedFileClientOptions { Scope = "ctr-123" });
821var result = await client.DeleteAsync("cfile-nonexistent", new HostedFileClientOptions { Scope = "ctr-123" });
872var result = await client.UploadAsync(contentStream, "text/csv", "data.csv", new HostedFileClientOptions
Microsoft.Extensions.AI.Tests (8)
Files\OpenTelemetryHostedFileClientTests.cs (7)
51await client.UploadAsync(stream, "text/plain", "test.txt", new HostedFileClientOptions { Purpose = "assistants", Scope = "container-1" });
103using var stream = await client.DownloadAsync("file-xyz", new HostedFileClientOptions { Scope = "container-2" });
143await client.GetFileInfoAsync("file-info", new HostedFileClientOptions { Scope = "container-3" });
198await foreach (var file in client.ListFilesAsync(new HostedFileClientOptions { Purpose = "assistants", Scope = "container-4" }))
239await client.DeleteAsync("file-del", new HostedFileClientOptions { Scope = "container-5" });
547await client.UploadAsync(stream, options: new HostedFileClientOptions
584await client.UploadAsync(stream, options: new HostedFileClientOptions
83 references to HostedFileClientOptions
Microsoft.Extensions.AI (11)
Files\LoggingHostedFileClient.cs (5)
60Stream content, string? mediaType = null, string? fileName = null, HostedFileClientOptions? options = null, CancellationToken cancellationToken = default)
109string fileId, HostedFileClientOptions? options = null, CancellationToken cancellationToken = default)
145string fileId, HostedFileClientOptions? options = null, CancellationToken cancellationToken = default)
191HostedFileClientOptions? options = null, [EnumeratorCancellation] CancellationToken cancellationToken = default)
264string fileId, HostedFileClientOptions? options = null, CancellationToken cancellationToken = default)
Files\OpenTelemetryHostedFileClient.cs (6)
136Stream content, string? mediaType = null, string? fileName = null, HostedFileClientOptions? options = null, CancellationToken cancellationToken = default)
200string fileId, HostedFileClientOptions? options = null, CancellationToken cancellationToken = default)
237string fileId, HostedFileClientOptions? options = null, CancellationToken cancellationToken = default)
288HostedFileClientOptions? options = null, [EnumeratorCancellation] CancellationToken cancellationToken = default)
364string fileId, HostedFileClientOptions? options = null, CancellationToken cancellationToken = default)
401private void TagAdditionalProperties(Activity activity, HostedFileClientOptions? options)
Microsoft.Extensions.AI.Abstractions (25)
Microsoft.Extensions.AI.Abstractions.Tests (28)
TestHostedFileClient.cs (10)
21public Func<Stream, string?, string?, HostedFileClientOptions?, CancellationToken, Task<HostedFileContent>>? UploadAsyncCallback { get; set; }
23public Func<string, HostedFileClientOptions?, CancellationToken, Task<HostedFileDownloadStream>>? DownloadAsyncCallback { get; set; }
25public Func<string, HostedFileClientOptions?, CancellationToken, Task<HostedFileContent?>>? GetFileInfoAsyncCallback { get; set; }
27public Func<HostedFileClientOptions?, CancellationToken, IAsyncEnumerable<HostedFileContent>>? ListFilesAsyncCallback { get; set; }
29public Func<string, HostedFileClientOptions?, CancellationToken, Task<bool>>? DeleteAsyncCallback { get; set; }
40HostedFileClientOptions? options = null,
46HostedFileClientOptions? options = null,
52HostedFileClientOptions? options = null,
57HostedFileClientOptions? options = null,
63HostedFileClientOptions? options = null,
Microsoft.Extensions.AI.OpenAI (9)
Microsoft.Extensions.AI.Tests (10)
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\TestHostedFileClient.cs (10)
21public Func<Stream, string?, string?, HostedFileClientOptions?, CancellationToken, Task<HostedFileContent>>? UploadAsyncCallback { get; set; }
23public Func<string, HostedFileClientOptions?, CancellationToken, Task<HostedFileDownloadStream>>? DownloadAsyncCallback { get; set; }
25public Func<string, HostedFileClientOptions?, CancellationToken, Task<HostedFileContent?>>? GetFileInfoAsyncCallback { get; set; }
27public Func<HostedFileClientOptions?, CancellationToken, IAsyncEnumerable<HostedFileContent>>? ListFilesAsyncCallback { get; set; }
29public Func<string, HostedFileClientOptions?, CancellationToken, Task<bool>>? DeleteAsyncCallback { get; set; }
40HostedFileClientOptions? options = null,
46HostedFileClientOptions? options = null,
52HostedFileClientOptions? options = null,
57HostedFileClientOptions? options = null,
63HostedFileClientOptions? options = null,