Share via


DelegatingHostedFileClient.DownloadAsync Method

Definition

Downloads a file from the AI service.

public virtual System.Threading.Tasks.Task<Microsoft.Extensions.AI.HostedFileDownloadStream> DownloadAsync(string fileId, Microsoft.Extensions.AI.HostedFileClientOptions? options = default, System.Threading.CancellationToken cancellationToken = default);
abstract member DownloadAsync : string * Microsoft.Extensions.AI.HostedFileClientOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Extensions.AI.HostedFileDownloadStream>
override this.DownloadAsync : string * Microsoft.Extensions.AI.HostedFileClientOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Extensions.AI.HostedFileDownloadStream>
Public Overridable Function DownloadAsync (fileId As String, Optional options As HostedFileClientOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of HostedFileDownloadStream)

Parameters

fileId
String

The ID of the file to download.

options
HostedFileClientOptions

Options to configure the download.

cancellationToken
CancellationToken

The CancellationToken to monitor for cancellation requests. The default is None.

Returns

A HostedFileDownloadStream containing the file content. The stream should be disposed when no longer needed.

Implements

Applies to