Table of Contents

Class SearchTypes

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

Different types of search that can be enabled on the GoogleSearch tool.

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

Properties

ImageSearch

Optional. Setting this field enables image search. Image bytes are returned.

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

Property Value

ImageSearch

WebSearch

Optional. Setting this field enables web search. Only text results are returned.

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

Property Value

WebSearch

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a SearchTypes object.

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

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

SearchTypes

The deserialized SearchTypes object, or null if deserialization fails.