Table of Contents

Class Retrieval

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

Defines a retrieval tool that model can call to access external knowledge. This data type is not supported in Gemini API.

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

Properties

DisableAttribution

Optional. Deprecated. This option is no longer supported.

[JsonPropertyName("disableAttribution")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? DisableAttribution { get; set; }

Property Value

bool?

ExternalApi

Use data source powered by external API for grounding.

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

Property Value

ExternalApi

VertexAiSearch

Set to use data source powered by Vertex AI Search.

[JsonPropertyName("vertexAiSearch")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public VertexAISearch? VertexAiSearch { get; set; }

Property Value

VertexAISearch

VertexRagStore

Set to use data source powered by Vertex RAG store. User data is uploaded via the VertexRagDataService.

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

Property Value

VertexRagStore

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a Retrieval object.

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

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

Retrieval

The deserialized Retrieval object, or null if deserialization fails.