Table of Contents

Class RagRetrievalConfigHybridSearch

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

Config for Hybrid Search. This data type is not supported in Gemini API.

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

Properties

Alpha

Optional. Alpha value controls the weight between dense and sparse vector search results. The range is [0, 1], while 0 means sparse vector search only and 1 means dense vector search only. The default value is 0.5 which balances sparse and dense vector search equally.

[JsonPropertyName("alpha")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public double? Alpha { get; set; }

Property Value

double?

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a RagRetrievalConfigHybridSearch object.

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

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

RagRetrievalConfigHybridSearch

The deserialized RagRetrievalConfigHybridSearch object, or null if deserialization fails.