FileClientUploadFileAsync Method

Uploads a file to the remote server and creates a RemoteFile object.

Definition

Namespace: GenerativeAI.Clients
Assembly: GenerativeAI (in GenerativeAI.dll) Version: 2.0.2+aa51399cad6d90cc71158d589a6268608b3c1893
C#
public Task<RemoteFile> UploadFileAsync(
	string filePath,
	Action<double>? progressCallback = null,
	CancellationToken cancellationToken = default
)

Parameters

filePath  String
The path to the file to upload.
progressCallback  ActionDouble  (Optional)
An optional callback to report the upload progress.
cancellationToken  CancellationToken  (Optional)
An optional token to cancel the upload operation.

Return Value

TaskRemoteFile
The uploaded file's information as a RemoteFile object.

See Also