Vectara查询配置#

class langchain_community.vectorstores.vectara.VectaraQueryConfig(k: int = 10, lambda_val: float = 0.0, filter: str = '', score_threshold: float | None = None, n_sentence_before: int = 2, n_sentence_after: int = 2, n_sentence_context: int | None = None, mmr_config: MMRConfig | None = None, summary_config: SummaryConfig | None = None, rerank_config: RerankConfig | None = None)[source]#

Vectara查询的配置。

k: 返回的文档数量。默认为10。 lambda_val: 混合搜索的词汇匹配参数。 filter 用于过滤元数据的参数字典。例如 a

过滤器可以是“doc.rating > 3.0 and part.lang = ‘deu’”} 更多详情请参见 https://docs.vectara.com/docs/search-apis/sql/filter-overview

score_threshold: minimal score threshold for the result.

如果定义了,得分低于此值的结果将被过滤掉。

n_sentence_before: number of sentences before the matching segment

添加,默认为2

n_sentence_after: number of sentences before the matching segment

要添加,默认为2

rerank_config: RerankConfig 配置数据类 summary_config: SummaryConfig 配置数据类

属性

filter

k

lambda_val

n_sentence_after

n_sentence_before

score_threshold

方法

__init__([k, lambda_val, filter, ...])

Parameters:
  • k (整数)

  • lambda_val (float)

  • filter (str)

  • score_threshold (float | None)

  • n_sentence_before (int)

  • n_sentence_after (int)

  • n_sentence_context (可选[整数])

  • mmr_config (可选[MMRConfig])

  • summary_config (SummaryConfig)

  • rerank_config (RerankConfig)

__init__(k: int = 10, lambda_val: float = 0.0, filter: str = '', score_threshold: float | None = None, n_sentence_before: int = 2, n_sentence_after: int = 2, n_sentence_context: int | None = None, mmr_config: MMRConfig | None = None, summary_config: SummaryConfig | None = None, rerank_config: RerankConfig | None = None)[来源]#
Parameters:
  • k (整数)

  • lambda_val (float)

  • filter (str)

  • score_threshold (float | None)

  • n_sentence_before (int)

  • n_sentence_after (int)

  • n_sentence_context (int | None)

  • mmr_config (MMRConfig | None)

  • summary_config (SummaryConfig | None)

  • rerank_config (RerankConfig | None)

使用 VectaraQueryConfig 的示例