Class GoogleSearch

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

public abstract class GoogleSearch extends JsonSerializable
Tool to support web search.
  • Constructor Details

    • GoogleSearch

      public GoogleSearch()
  • Method Details

    • searchTypes

      public abstract Optional<SearchTypes> searchTypes()
      Different types of search that can be enabled on the GoogleSearch tool.
    • blockingConfidence

      public abstract Optional<PhishBlockThreshold> blockingConfidence()
      Optional. Sites with confidence level chosen & above this value will be blocked from the search results. This field is not supported in Gemini API.
    • excludeDomains

      public abstract Optional<List<String>> excludeDomains()
      Optional. List of domains to be excluded from the search results. The default limit is 2000 domains. Example: ["amazon.com", "facebook.com"]. This field is not supported in Gemini API.
    • timeRangeFilter

      public abstract Optional<Interval> timeRangeFilter()
      Optional. Filter search results to a specific time range. If customers set a start time, they must set an end time (and vice versa). This field is not supported in Vertex AI.
    • builder

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

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

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