OpenAIAssistantAgent.UploadFileAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.