mirror of
https://github.com/imartinez/privateGPT.git
synced 2025-08-01 23:47:54 +00:00
Added second variable for the rag
This commit is contained in:
parent
f945d18a6f
commit
e65d47fad5
@ -130,12 +130,12 @@ class VectorStoreComponent:
|
||||
self,
|
||||
index: VectorStoreIndex,
|
||||
context_filter: ContextFilter | None = None,
|
||||
similarity_top_k: int = 2,
|
||||
sim_top_k = settings.rag.similarity_top_k,
|
||||
) -> VectorIndexRetriever:
|
||||
# This way we support qdrant (using doc_ids) and the rest (using filters)
|
||||
return VectorIndexRetriever(
|
||||
index=index,
|
||||
similarity_top_k=similarity_top_k,
|
||||
similarity_top_k=sim_top_k,
|
||||
doc_ids=context_filter.docs_ids if context_filter else None,
|
||||
filters=(
|
||||
_doc_id_metadata_filter(context_filter)
|
||||
|
@ -108,6 +108,10 @@ class RagSettings(BaseModel):
|
||||
None,
|
||||
description="If set, any documents retrieved from the RAG must meet a certain score. Acceptable values are between 0 and 1.",
|
||||
)
|
||||
similarity_top_k: int = Field(
|
||||
2,
|
||||
description="An integer that specifies the number of documents to use when searching the RAG database",
|
||||
)
|
||||
|
||||
|
||||
class VectorstoreSettings(BaseModel):
|
||||
|
Loading…
Reference in New Issue
Block a user