add vector field for other vectordb (#7051)

This commit is contained in:
Jyong
2024-08-07 17:14:03 +08:00
committed by GitHub
parent aad02113c6
commit 80c94f02e9
10 changed files with 23 additions and 14 deletions

View File

@@ -285,9 +285,11 @@ class AnalyticdbVector(BaseVector):
documents = []
for match in response.body.matches.match:
if match.score > score_threshold:
metadata = json.loads(match.metadata.get("metadata_"))
doc = Document(
page_content=match.metadata.get("page_content"),
metadata=json.loads(match.metadata.get("metadata_")),
vector=match.metadata.get("vector"),
metadata=metadata,
)
documents.append(doc)
return documents