Package com.google.genai
Class AsyncFileSearchStores
java.lang.Object
com.google.genai.AsyncFileSearchStores
Async module of
FileSearchStores-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate(CreateFileSearchStoreConfig config) delete(String name, DeleteFileSearchStoreConfig config) CompletableFuture<byte[]>downloadMedia(String uri, DownloadMediaConfig config) Downloads media using a Media ID or URI.get(String name, GetFileSearchStoreConfig config) importFile(String fileSearchStoreName, String fileName, ImportFileConfig config) list(ListFileSearchStoresConfig config) Asynchronously makes an API request to list the available file search stores.uploadToFileSearchStore(String fileSearchStoreName, byte[] bytes, UploadToFileSearchStoreConfig config) Uploads a file in bytes format to the file search store.uploadToFileSearchStore(String fileSearchStoreName, File file, UploadToFileSearchStoreConfig config) Uploads a file to the file search store.uploadToFileSearchStore(String fileSearchStoreName, InputStream inputStream, long size, UploadToFileSearchStoreConfig config) Uploads a file as input stream to the API.uploadToFileSearchStore(String fileSearchStoreName, String filePath, UploadToFileSearchStoreConfig config) Uploads a file to the API.
-
Field Details
-
documents
-
-
Constructor Details
-
AsyncFileSearchStores
-
-
Method Details
-
create
-
get
-
delete
-
importFile
public CompletableFuture<ImportFileOperation> importFile(String fileSearchStoreName, String fileName, ImportFileConfig config) -
list
Asynchronously makes an API request to list the available file search stores.- Parameters:
config- AListFileSearchStoresConfigfor configuring the list request.- Returns:
- A CompletableFuture that resolves to a
AsyncPager. The AsyncPager has a `forEach` method that can be used to asynchronously process items in the page and automatically query the next page once the current page is exhausted.
-
uploadToFileSearchStore
public CompletableFuture<UploadToFileSearchStoreOperation> uploadToFileSearchStore(String fileSearchStoreName, File file, UploadToFileSearchStoreConfig config) Uploads a file to the file search store.- Parameters:
fileSearchStoreName- The name of the file search store to upload to.file- The file to upload.config- The configuration for the upload.- Returns:
- The long running operation of uploading.
-
uploadToFileSearchStore
public CompletableFuture<UploadToFileSearchStoreOperation> uploadToFileSearchStore(String fileSearchStoreName, byte[] bytes, UploadToFileSearchStoreConfig config) Uploads a file in bytes format to the file search store.- Parameters:
fileSearchStoreName- The name of the file search store to upload to.bytes- The bytes of the file to upload.config- The configuration for the upload.- Returns:
- The long running operation of uploading.
-
uploadToFileSearchStore
public CompletableFuture<UploadToFileSearchStoreOperation> uploadToFileSearchStore(String fileSearchStoreName, InputStream inputStream, long size, UploadToFileSearchStoreConfig config) Uploads a file as input stream to the API.- Parameters:
fileSearchStoreName- The name of the file search store to upload to.inputStream- The input stream of the file to upload.size- The size of the file to upload.config- The configuration for the upload.- Returns:
- The uploaded file.
-
uploadToFileSearchStore
public CompletableFuture<UploadToFileSearchStoreOperation> uploadToFileSearchStore(String fileSearchStoreName, String filePath, UploadToFileSearchStoreConfig config) Uploads a file to the API.- Parameters:
fileSearchStoreName- The name of the file search store to upload to.filePath- The path of the file to upload.config- The configuration for the upload.- Returns:
- The uploaded file.
-
downloadMedia
Downloads media using a Media ID or URI. This method is only supported in the Gemini Developer client.- Parameters:
uri- The URI or Media ID of the blob.config- Optional configuration for the download.- Returns:
- A CompletableFuture that resolves to the blob data as a byte array.
-