FileClientUploadStreamAsync Method

Uploads a file stream as a RemoteFile to the remote server.

Definition

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

Parameters

stream  Stream
The stream representing the file to upload.
displayName  String
The display name of the file being uploaded.
mimeType  String
The MIME type of the file being uploaded.
progressCallback  ActionDouble  (Optional)
An optional callback to track the progress of the upload, represented as a percentage.
cancellationToken  CancellationToken  (Optional)

[Missing <param name="cancellationToken"/> documentation for "M:GenerativeAI.Clients.FileClient.UploadStreamAsync(System.IO.Stream,System.String,System.String,System.Action{System.Double},System.Threading.CancellationToken)"]

Return Value

TaskRemoteFile
The uploaded RemoteFile information.

See Also