OpenAIClientExtensions.UploadAssistantFileAsync Method

Definition

Uploads a file to use with the assistant.

public static System.Threading.Tasks.Task<string> UploadAssistantFileAsync(this OpenAI.OpenAIClient client, System.IO.Stream stream, string name, System.Threading.CancellationToken cancellationToken = default);
static member UploadAssistantFileAsync : OpenAI.OpenAIClient * System.IO.Stream * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<string>
<Extension()>
Public Function UploadAssistantFileAsync (client As OpenAIClient, stream As Stream, name As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of String)

Parameters

client
OpenAI.OpenAIClient

The OpenAI client instance.

stream
Stream

The content to upload.

name
String

The name of the file.

cancellationToken
CancellationToken

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

Returns

The file identifier.

Remarks

Use the OpenAI.Files.OpenAIFileClient directly for more advanced file operations.

Applies to