다음을 통해 공유


AssistantsClient.UploadFile Method

Definition

Overloads

UploadFile(String, OpenAIFilePurpose, CancellationToken)

Uploads a file from a local file path accessible to File.

UploadFile(Stream, OpenAIFilePurpose, String, CancellationToken)

Uploads a file for use by other operations.

UploadFile(String, OpenAIFilePurpose, CancellationToken)

Source:
AssistantsClient.cs

Uploads a file from a local file path accessible to File.

public virtual Azure.Response<Azure.AI.OpenAI.Assistants.OpenAIFile> UploadFile (string localFilePath, Azure.AI.OpenAI.Assistants.OpenAIFilePurpose purpose, System.Threading.CancellationToken cancellationToken = default);
abstract member UploadFile : string * Azure.AI.OpenAI.Assistants.OpenAIFilePurpose * System.Threading.CancellationToken -> Azure.Response<Azure.AI.OpenAI.Assistants.OpenAIFile>
override this.UploadFile : string * Azure.AI.OpenAI.Assistants.OpenAIFilePurpose * System.Threading.CancellationToken -> Azure.Response<Azure.AI.OpenAI.Assistants.OpenAIFile>
Public Overridable Function UploadFile (localFilePath As String, purpose As OpenAIFilePurpose, Optional cancellationToken As CancellationToken = Nothing) As Response(Of OpenAIFile)

Parameters

localFilePath
String

The local file path.

purpose
OpenAIFilePurpose

The intended purpose of the uploaded file.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Applies to

UploadFile(Stream, OpenAIFilePurpose, String, CancellationToken)

Source:
AssistantsClient.cs

Uploads a file for use by other operations.

public virtual Azure.Response<Azure.AI.OpenAI.Assistants.OpenAIFile> UploadFile (System.IO.Stream data, Azure.AI.OpenAI.Assistants.OpenAIFilePurpose purpose, string filename = default, System.Threading.CancellationToken cancellationToken = default);
abstract member UploadFile : System.IO.Stream * Azure.AI.OpenAI.Assistants.OpenAIFilePurpose * string * System.Threading.CancellationToken -> Azure.Response<Azure.AI.OpenAI.Assistants.OpenAIFile>
override this.UploadFile : System.IO.Stream * Azure.AI.OpenAI.Assistants.OpenAIFilePurpose * string * System.Threading.CancellationToken -> Azure.Response<Azure.AI.OpenAI.Assistants.OpenAIFile>
Public Overridable Function UploadFile (data As Stream, purpose As OpenAIFilePurpose, Optional filename As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Response(Of OpenAIFile)

Parameters

data
Stream

The file data (not filename) to upload.

purpose
OpenAIFilePurpose

The intended purpose of the file.

filename
String

A filename to associate with the uploaded data.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

data is null.

Applies to