52 references to new
Microsoft.Extensions.AI.Abstractions (2)
Files\HostedFileClientExtensions.cs (1)
160options = options?.Clone() ?? new();
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.HostedFileClientOptions.g.cs (1)
33ObjectCreator = () => new global::Microsoft.Extensions.AI.HostedFileClientOptions(),
Microsoft.Extensions.AI.Abstractions.Tests (10)
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()
Generated\361d1da7f942c932\TestJsonSerializerContext.HostedFileClientOptions.g.cs (1)
31ObjectCreator = () => new global::Microsoft.Extensions.AI.HostedFileClientOptions(),
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