Class ToolSearch

java.lang.Object
com.google.genai.gaos.models.interactions.ToolSearch
All Implemented Interfaces:
Tool

public class ToolSearch extends Object implements Tool
ToolSearch

A tool that allows the model to dynamically search for and load tools into the model’s context on demand. This allows clients to avoid loading all tool definitions up front and may help reduce overall token usage and cost.

  • Constructor Details

    • ToolSearch

      public ToolSearch(@Nullable String description, @Nullable Execution execution, @Nullable String name, @Nullable Object parameters)
    • ToolSearch

      public ToolSearch()
  • Method Details

    • description

      public Optional<String> description()
      A description of the function. To be set only for client-side execution.
    • execution

      public Optional<Execution> execution()
      The execution mode of the tool search.
    • name

      public Optional<String> name()
      The name of the function. To be set only for client-side execution.
    • parameters

      public Optional<Object> parameters()
      The JSON Schema for the function's parameters. To be set only for client-side execution.
    • type

      public String type()
      Specified by:
      type in interface Tool
    • builder

      public static ToolSearch.Builder builder()
    • withDescription

      public ToolSearch withDescription(@Nullable String description)
      A description of the function. To be set only for client-side execution.
    • withExecution

      public ToolSearch withExecution(@Nullable Execution execution)
      The execution mode of the tool search.
    • withName

      public ToolSearch withName(@Nullable String name)
      The name of the function. To be set only for client-side execution.
    • withParameters

      public ToolSearch withParameters(@Nullable Object parameters)
      The JSON Schema for the function's parameters. To be set only for client-side execution.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object