Class GoogleSearch.Builder

java.lang.Object
com.google.genai.types.GoogleSearch.Builder
Enclosing class:
GoogleSearch

public abstract static class GoogleSearch.Builder extends Object
Builder for GoogleSearch.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • excludeDomains

      public abstract GoogleSearch.Builder excludeDomains(List<String> excludeDomains)
      Setter for excludeDomains.

      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.

    • excludeDomains

      @CanIgnoreReturnValue public GoogleSearch.Builder excludeDomains(String... excludeDomains)
      Setter for excludeDomains.

      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.

    • clearExcludeDomains

      @CanIgnoreReturnValue public GoogleSearch.Builder clearExcludeDomains()
      Clears the value of excludeDomains field.
    • blockingConfidence

      public abstract GoogleSearch.Builder blockingConfidence(PhishBlockThreshold blockingConfidence)
      Setter for blockingConfidence.

      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.

    • clearBlockingConfidence

      @CanIgnoreReturnValue public GoogleSearch.Builder clearBlockingConfidence()
      Clears the value of blockingConfidence field.
    • blockingConfidence

      @CanIgnoreReturnValue public GoogleSearch.Builder blockingConfidence(PhishBlockThreshold.Known knownType)
      Setter for blockingConfidence given a known enum.

      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.

    • blockingConfidence

      @CanIgnoreReturnValue public GoogleSearch.Builder blockingConfidence(String blockingConfidence)
      Setter for blockingConfidence given a string.

      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.

    • timeRangeFilter

      public abstract GoogleSearch.Builder timeRangeFilter(Interval timeRangeFilter)
      Setter for timeRangeFilter.

      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.

    • timeRangeFilter

      @CanIgnoreReturnValue public GoogleSearch.Builder timeRangeFilter(Interval.Builder timeRangeFilterBuilder)
      Setter for timeRangeFilter builder.

      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.

    • clearTimeRangeFilter

      @CanIgnoreReturnValue public GoogleSearch.Builder clearTimeRangeFilter()
      Clears the value of timeRangeFilter field.
    • build

      public abstract GoogleSearch build()