fix:score threshold (#24897)
This commit is contained in:
parent
9486715929
commit
2042353526
24 changed files with 25 additions and 25 deletions
|
|
@ -256,7 +256,7 @@ class AnalyticdbVectorOpenAPI:
|
|||
response = self._client.query_collection_data(request)
|
||||
documents = []
|
||||
for match in response.body.matches.match:
|
||||
if match.score > score_threshold:
|
||||
if match.score >= score_threshold:
|
||||
metadata = json.loads(match.metadata.get("metadata_"))
|
||||
metadata["score"] = match.score
|
||||
doc = Document(
|
||||
|
|
@ -293,7 +293,7 @@ class AnalyticdbVectorOpenAPI:
|
|||
response = self._client.query_collection_data(request)
|
||||
documents = []
|
||||
for match in response.body.matches.match:
|
||||
if match.score > score_threshold:
|
||||
if match.score >= score_threshold:
|
||||
metadata = json.loads(match.metadata.get("metadata_"))
|
||||
metadata["score"] = match.score
|
||||
doc = Document(
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ class AnalyticdbVectorBySql:
|
|||
documents = []
|
||||
for record in cur:
|
||||
id, vector, score, page_content, metadata = record
|
||||
if score > score_threshold:
|
||||
if score >= score_threshold:
|
||||
metadata["score"] = score
|
||||
doc = Document(
|
||||
page_content=page_content,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue