Table of Contents

Class GoogleSearch

Namespace
Google.GenAI.Types
Assembly
Google.GenAI.dll

GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.

public record GoogleSearch : IEquatable<GoogleSearch>
Inheritance
GoogleSearch
Implements
Inherited Members

Properties

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.

[JsonPropertyName("blockingConfidence")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public PhishBlockThreshold? BlockingConfidence { get; set; }

Property Value

PhishBlockThreshold?

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.

[JsonPropertyName("excludeDomains")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<string>? ExcludeDomains { get; set; }

Property Value

List<string>

SearchTypes

Optional. The set of search types to enable. If not set, web search is enabled by default.

[JsonPropertyName("searchTypes")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public SearchTypes? SearchTypes { get; set; }

Property Value

SearchTypes

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.

[JsonPropertyName("timeRangeFilter")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Interval? TimeRangeFilter { get; set; }

Property Value

Interval

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a GoogleSearch object.

public static GoogleSearch? FromJson(string jsonString, JsonSerializerOptions? options = null)

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

GoogleSearch

The deserialized GoogleSearch object, or null if deserialization fails.