RagRetrievalConfig

Specifies the context retrieval config.

Fields
topK integer

Optional. The number of contexts to retrieve.

filter object (Filter)

Optional. Config for filters.

JSON representation
{
  "topK": integer,
  "filter": {
    object (Filter)
  }
}

Filter

Config for filters.

Fields
metadataFilter string

Optional. String for metadata filtering.

vector_db_threshold Union type
Filter contexts retrieved from the vector DB based on either vector distance or vector similarity. vector_db_threshold can be only one of the following:
vectorDistanceThreshold number

Optional. Only returns contexts with vector distance smaller than the threshold.

vectorSimilarityThreshold number

Optional. Only returns contexts with vector similarity larger than the threshold.

JSON representation
{
  "metadataFilter": string,

  // vector_db_threshold
  "vectorDistanceThreshold": number,
  "vectorSimilarityThreshold": number
  // Union type
}