Share via


OpenAIAssistantAgent.UploadFileAsync Method

Definition

Uploads an file for the purpose of using with assistant.

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

Parameters

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.FileClient directly for more advanced file operations.

Applies to