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