template: Update Vectara templates (#15363)

fixed multi-query template for Vectara
added self-query template for Vectara

Also added prompt_name parameter to summarization

CC @efriis 
 **Twitter handle:** @ofermend
This commit is contained in:
Ofer Mendelevitch
2024-01-19 17:32:33 -08:00
committed by GitHub
parent 1e29b676d5
commit ffae98d371
3 changed files with 10 additions and 6 deletions

View File

@@ -22,11 +22,14 @@ class SummaryConfig:
is_enabled: True if summary is enabled, False otherwise
max_results: maximum number of results to summarize
response_lang: requested language for the summary
prompt_name: name of the prompt to use for summarization
(see https://docs.vectara.com/docs/learn/grounded-generation/select-a-summarizer)
"""
is_enabled: bool = False
max_results: int = 7
response_lang: str = "eng"
prompt_name: str = "vectara-summary-ext-v1.2.0"
@dataclass
@@ -364,6 +367,7 @@ class Vectara(VectorStore):
{
"maxSummarizedResults": config.summary_config.max_results,
"responseLang": config.summary_config.response_lang,
"summarizerPromptName": config.summary_config.prompt_name,
}
]
@@ -570,6 +574,7 @@ class VectaraRetriever(VectorStoreRetriever):
"k": 5,
"filter": "",
"n_sentence_context": "2",
"summary_config": SummaryConfig(),
}
)