Class VertexAiSearchTool

java.lang.Object
com.google.adk.tools.BaseTool
com.google.adk.tools.VertexAiSearchTool

public abstract class VertexAiSearchTool extends BaseTool
A built-in tool using Vertex AI Search.

This tool can be configured with either a dataStoreId (the Vertex AI search data store resource ID) or a searchEngineId (the Vertex AI search engine resource ID).

  • Method Details

    • dataStoreId

      public abstract Optional<String> dataStoreId()
    • dataStoreSpecs

      public abstract com.google.common.collect.ImmutableList<com.google.genai.types.VertexAISearchDataStoreSpec> dataStoreSpecs()
    • searchEngineId

      public abstract Optional<String> searchEngineId()
    • filter

      public abstract Optional<String> filter()
    • maxResults

      public abstract Optional<Integer> maxResults()
    • project

      public abstract Optional<String> project()
    • location

      public abstract Optional<String> location()
    • dataStore

      public abstract Optional<String> dataStore()
    • builder

      public static VertexAiSearchTool.Builder builder()
    • processLlmRequest

      public io.reactivex.rxjava3.core.Completable processLlmRequest(LlmRequest.Builder llmRequestBuilder, ToolContext toolContext)
      Description copied from class: BaseTool
      Processes the outgoing LlmRequest.Builder.

      This implementation adds the current tool's BaseTool.declaration() to the GenerateContentConfig within the builder. If a tool with function declarations already exists, the current tool's declaration is merged into it. Otherwise, a new tool definition with the current tool's declaration is created. The current tool itself is also added to the builder's internal list of tools. Override this method for processing the outgoing request.

      Overrides:
      processLlmRequest in class BaseTool