feat(core): Support RAG chat flow (#1185)

This commit is contained in:
Fangyin Cheng
2024-02-23 11:44:44 +08:00
committed by GitHub
parent 21682575f5
commit e0986198a6
9 changed files with 134 additions and 54 deletions

View File

@@ -339,9 +339,7 @@ class MilvusStore(VectorStoreBase):
self.vector_field = x.name
_, docs_and_scores = self._search(text, topk)
if any(score < 0.0 or score > 1.0 for _, score, id in docs_and_scores):
import warnings
warnings.warn(
logger.warning(
"similarity score need between" f" 0 and 1, got {docs_and_scores}"
)
@@ -357,7 +355,7 @@ class MilvusStore(VectorStoreBase):
if score >= score_threshold
]
if len(docs_and_scores) == 0:
warnings.warn(
logger.warning(
"No relevant docs were retrieved using the relevance score"
f" threshold {score_threshold}"
)