Class FileSearch

java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.FileSearch

public abstract class FileSearch extends JsonSerializable
The FileSearch tool that retrieves knowledge from Semantic Retrieval corpora. Files are imported to Semantic Retrieval corpora using the ImportFile API. This data type is not supported in Vertex AI.
  • Constructor Details

    • FileSearch

      public FileSearch()
  • Method Details

    • fileSearchStoreNames

      public abstract Optional<List<String>> fileSearchStoreNames()
      Required. The names of the file_search_stores to retrieve from. Example: `fileSearchStores/my-file-search-store-123`
    • topK

      public abstract Optional<Integer> topK()
      Optional. The number of semantic retrieval chunks to retrieve.
    • metadataFilter

      public abstract Optional<String> metadataFilter()
      Optional. Metadata filter to apply to the semantic retrieval documents and chunks.
    • builder

      public static FileSearch.Builder builder()
      Instantiates a builder for FileSearch.
    • toBuilder

      public abstract FileSearch.Builder toBuilder()
      Creates a builder with the same values as this instance.
    • fromJson

      public static FileSearch fromJson(String jsonString)
      Deserializes a JSON string to a FileSearch object.