Class FileSearchStores

java.lang.Object
com.google.genai.FileSearchStores

public final class FileSearchStores extends Object
  • Field Details

    • documents

      public final Documents documents
  • Constructor Details

    • FileSearchStores

      public FileSearchStores(ApiClient apiClient)
  • Method Details

    • create

    • get

      public FileSearchStore get(String name, GetFileSearchStoreConfig config)
    • delete

      public void delete(String name, DeleteFileSearchStoreConfig config)
    • importFile

      public ImportFileOperation importFile(String fileSearchStoreName, String fileName, ImportFileConfig config)
    • list

      Makes an API request to list the available file search stores.
      Parameters:
      config - A ListFileSearchStoresConfig for configuring the list request.
      Returns:
      A Pager object that contains the list of file search stores. The pager is an iterable and automatically queries the next page once the current page is exhausted.
    • uploadToFileSearchStore

      public 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 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 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 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

      public byte[] downloadMedia(String uri, DownloadMediaConfig config)
      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:
      The blob data as a byte array.