langchain_community.vectorstores.vectara
.VectaraQueryConfig¶
- class langchain_community.vectorstores.vectara.VectaraQueryConfig(k: int = 10, lambda_val: float = 0.0, filter: str = '', score_threshold: Optional[float] = None, n_sentence_before: int = 2, n_sentence_after: int = 2, n_sentence_context: Optional[int] = None, mmr_config: Optional[MMRConfig] = None, summary_config: Optional[SummaryConfig] = None, rerank_config: Optional[RerankConfig] = None)[source]¶
矢卡拉查询配置。
k: 返回的文档数量。默认为10。lambda_val: 混合搜索的词法匹配参数。filter: 要过滤的元数据的参数字典。例如,一个
filter可以是“doc.rating > 3.0 and part.lang = ‘deu’”} 详情请见https://docs.vectara.com/docs/search-apis/sql/filter-overview。
- score_threshold: 结果的最小分数阈值。
如果定义了此值,则低于此值的分数将被过滤。
- 前n_sentence_before: 匹配片段之前的句子数
添加项,默认为2
- n_sentence_after: 匹配片段之前的句子数
添加项,默认为2
rerank_config: RerankConfig配置数据类摘要_config: SummaryConfig配置数据类
属性
filter
k
lambda_val
n_sentence_after
n_sentence_before
score_threshold
rerank_config
summary_config
方法
__init__
([k, lambda_val, filter, ...])- 参数
k (int) –
lambda_val (float) –
filter (str) –
score_threshold (Optional[float]) –
n_sentence_before (int) –
n_sentence_after (int) –
n_sentence_context (Optional[int]) –
mmr_config (Optional[MMRConfig]) –
summary_config (SummaryConfig) –
rerank_config (RerankConfig) –
- __init__(k: int = 10, lambda_val: float = 0.0, filter: str = '', score_threshold: Optional[float] = None, n_sentence_before: int = 2, n_sentence_after: int = 2, n_sentence_context: Optional[int] = None, mmr_config: Optional[MMRConfig] = None, summary_config: Optional[SummaryConfig] = None, rerank_config: Optional[RerankConfig] = None)[source]¶
- 参数
k (int) –
lambda_val (float) –
filter (str) –
score_threshold (Optional[float]) –
n_sentence_before (int) –
n_sentence_after (int) –
n_sentence_context (Optional[int]) –
mmr_config (Optional[MMRConfig]) –
summary_config (可选[SummaryConfig]) –
rerank_config (可选[RerankConfig]) –