Table of Contents

Class RagContextsContext

Namespace
GenerativeAI.Types.RagEngine
Assembly
GenerativeAI.dll

A context of the query.

public class RagContextsContext
Inheritance
RagContextsContext
Inherited Members
Extension Methods

Properties

Distance

The distance between the query dense embedding vector and the context text vector.

[JsonPropertyName("distance")]
[Obsolete("Use Score property instead. Distance property will be removed in a future version.")]
public double? Distance { get; set; }

Property Value

double?

Score

According to the underlying Vector DB and the selected metric type, the score can be either the distance or the similarity between the query and the context and its range depends on the metric type. For example, if the metric type is COSINE_DISTANCE, it represents the distance between the query and the context. The larger the distance, the less relevant the context is to the query. The range is [0, 2], while 0 means the most relevant and 2 means the least relevant.

[JsonPropertyName("score")]
public double? Score { get; set; }

Property Value

double?

SourceDisplayName

The file display name.

[JsonPropertyName("sourceDisplayName")]
public string? SourceDisplayName { get; set; }

Property Value

string

SourceUri

If the file is imported from Cloud Storage or Google Drive, source_uri will be original file URI in Cloud Storage or Google Drive; if file is uploaded, source_uri will be file display name.

[JsonPropertyName("sourceUri")]
public string? SourceUri { get; set; }

Property Value

string

SparseDistance

The distance between the query sparse embedding vector and the context text vector.

[JsonPropertyName("sparseDistance")]
[Obsolete("Use Score property instead. SparseDistance property will be removed in a future version.")]
public double? SparseDistance { get; set; }

Property Value

double?

Text

The text chunk.

[JsonPropertyName("text")]
public string? Text { get; set; }

Property Value

string