upload

Asynchronously uploads a file to the GenAI API.

Return

A future that resolves to the uploaded file.

Parameters

file

The file to upload.

config

The configuration for the upload.


public CompletableFuture<File> upload(Array<byte> bytes, UploadFileConfig config)

Asynchronously uploads a bytes array as a file to the GenAI API.

Return

A future that resolves to the uploaded file.

Parameters

bytes

The bytes of the file to upload.

config

The configuration for the upload.


public CompletableFuture<File> upload(InputStream stream, long size, UploadFileConfig config)

Asynchronously uploads a stream as a file to the GenAI API.

Return

A future that resolves to the uploaded file.

Parameters

stream

The stream of the file to upload.

size

The size of the file in bytes.

config

The configuration for the upload.


public CompletableFuture<File> upload(String filePath, UploadFileConfig config)

Asynchronously uploads a file by its path to the GenAI API.

Return

A future that resolves to the uploaded file.

Parameters

filePath

The path to the file to upload.

config

The configuration for the upload.