Table of Contents

Class ExternalApiElasticSearchParams

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

The search parameters to use for the ELASTIC_SEARCH spec. This data type is not supported in Gemini API.

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

Properties

Index

The ElasticSearch index to use.

[JsonPropertyName("index")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Index { get; set; }

Property Value

string

NumHits

Optional. Number of hits (chunks) to request. When specified, it is passed to Elasticsearch as the num_hits param.

[JsonPropertyName("numHits")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? NumHits { get; set; }

Property Value

int?

SearchTemplate

The ElasticSearch search template to use.

[JsonPropertyName("searchTemplate")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? SearchTemplate { get; set; }

Property Value

string

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a ExternalApiElasticSearchParams object.

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

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

ExternalApiElasticSearchParams

The deserialized ExternalApiElasticSearchParams object, or null if deserialization fails.