2 types derived from HostedFileClientOptions
Microsoft.Extensions.AI.Abstractions.Tests (2)
Files\HostedFileClientOptionsTests.cs (2)
77private class OptionsA : HostedFileClientOptions 118private class PassedNullToBaseOptions : HostedFileClientOptions
51 instantiations of HostedFileClientOptions
Microsoft.Extensions.AI.Abstractions (2)
Files\HostedFileClientExtensions.cs (1)
160options = options?.Clone() ?? new();
Files\HostedFileClientOptions.cs (1)
97public virtual HostedFileClientOptions Clone() => new(this);
Microsoft.Extensions.AI.Abstractions.Tests (9)
Files\DelegatingHostedFileClientTests.cs (5)
29var expectedOptions = new HostedFileClientOptions(); 58var expectedOptions = new HostedFileClientOptions(); 85var expectedOptions = new HostedFileClientOptions(); 111var expectedOptions = new HostedFileClientOptions(); 143var expectedOptions = new HostedFileClientOptions();
Files\HostedFileClientExtensionsTests.cs (1)
342var explicitOptions = new HostedFileClientOptions { Scope = "container-from-options" };
Files\HostedFileClientOptionsTests.cs (3)
17var options = new HostedFileClientOptions(); 37var options = new HostedFileClientOptions 129HostedFileClientOptions options = new()
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\LoggingHostedFileClientTests.cs (1)
70await client.UploadAsync(stream, "text/plain", "test.txt", new HostedFileClientOptions { Purpose = "assistants" });
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)
Files\DelegatingHostedFileClient.cs (5)
43HostedFileClientOptions? options = null, 50HostedFileClientOptions? options = null, 57HostedFileClientOptions? options = null, 63HostedFileClientOptions? options = null, 70HostedFileClientOptions? options = null,
Files\HostedFileClientExtensions.cs (5)
35HostedFileClientOptions? options = null, 62HostedFileClientOptions? options = null, 97HostedFileClientOptions? options = null, 152HostedFileClientOptions? options = null, 186HostedFileClientOptions? options = null,
Files\HostedFileClientOptions.cs (9)
16/// Initializes a new instance of the <see cref="HostedFileClientOptions"/> class. 23/// Initializes a new instance of the <see cref="HostedFileClientOptions"/> class 27protected HostedFileClientOptions(HostedFileClientOptions? other) 77/// When an operation is invoked with a <see cref="HostedFileClientOptions" />, that implementation may convert 83/// supplied on this <see cref="HostedFileClientOptions" /> instance or from other inputs, 87/// properties on <see cref="HostedFileClientOptions" />. 95/// <summary>Creates a shallow clone of the current <see cref="HostedFileClientOptions"/> instance.</summary> 96/// <returns>A shallow clone of the current <see cref="HostedFileClientOptions"/> instance.</returns> 97public virtual HostedFileClientOptions Clone() => new(this);
Files\IHostedFileClient.cs (5)
48HostedFileClientOptions? options = null, 64HostedFileClientOptions? options = null, 78HostedFileClientOptions? options = null, 88HostedFileClientOptions? options = null, 102HostedFileClientOptions? options = null,
Utilities\AIJsonUtilities.Defaults.cs (1)
143[JsonSerializable(typeof(HostedFileClientOptions))]
Microsoft.Extensions.AI.Abstractions.Tests (28)
Files\DelegatingHostedFileClientTests.cs (5)
29var expectedOptions = new HostedFileClientOptions(); 58var expectedOptions = new HostedFileClientOptions(); 85var expectedOptions = new HostedFileClientOptions(); 111var expectedOptions = new HostedFileClientOptions(); 143var expectedOptions = new HostedFileClientOptions();
Files\HostedFileClientExtensionsTests.cs (3)
323HostedFileClientOptions? capturedOptions = null; 342var explicitOptions = new HostedFileClientOptions { Scope = "container-from-options" }; 343HostedFileClientOptions? capturedOptions = null;
Files\HostedFileClientOptionsTests.cs (9)
17var options = new HostedFileClientOptions(); 24HostedFileClientOptions clone = options.Clone(); 37var options = new HostedFileClientOptions 52HostedFileClientOptions clone = options.Clone(); 70HostedFileClientOptions clone = b.Clone(); 91public override HostedFileClientOptions Clone() => new OptionsA(this); 108public override HostedFileClientOptions Clone() => new OptionsB(this); 129HostedFileClientOptions options = new() 139HostedFileClientOptions? deserialized = JsonSerializer.Deserialize(json, TestJsonSerializerContext.Default.HostedFileClientOptions);
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,
TestJsonSerializerContext.cs (1)
55[JsonSerializable(typeof(HostedFileClientOptions))]
Microsoft.Extensions.AI.OpenAI (9)
OpenAIClientExtensions.cs (1)
170/// in the <see cref="HostedFileClientOptions.Scope"/> property.
OpenAIHostedFileClient.cs (8)
34/// When a <see cref="HostedFileClientOptions.Scope"/> (container ID) is specified on a per-call options object 86/// provided via the <see cref="HostedFileClientOptions.Scope"/> property on per-call options. 100HostedFileClientOptions? options = null, 154HostedFileClientOptions? options = null, 187HostedFileClientOptions? options = null, 215HostedFileClientOptions? options = null, 283HostedFileClientOptions? options = null, 374private string? ResolveScope(HostedFileClientOptions? options) =>
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,