Table of Contents

Class FileSearch

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

The FileSearch tool that retrieves knowledge from Semantic Retrieval corpora. Files are imported to Semantic Retrieval corpora using the ImportFile API. This data type is not supported in Vertex AI.

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

Properties

FileSearchStoreNames

The names of the file_search_stores to retrieve from. Example: fileSearchStores/my-file-search-store-123

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

Property Value

List<string>

MetadataFilter

Optional. Metadata filter to apply to the semantic retrieval documents and chunks.

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

Property Value

string

TopK

Optional. The number of semantic retrieval chunks to retrieve.

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

Property Value

int?

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a FileSearch object.

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

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

FileSearch

The deserialized FileSearch object, or null if deserialization fails.