瀏覽代碼

tencent vectordb compatible with version 1.1.3 and below (#20056)

Co-authored-by: wlleiiwang <wlleiiwang@tencent.com>
tags/1.4.1
wlleiiwang 5 月之前
父節點
當前提交
7d230acf40
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 4 行新增1 行删除
  1. 4
    1
      api/core/rag/datasource/vdb/tencent/tencent_vector.py

+ 4
- 1
api/core/rag/datasource/vdb/tencent/tencent_vector.py 查看文件

@@ -271,12 +271,15 @@ class TencentVector(BaseVector):

for result in res[0]:
meta = result.get(self.field_metadata)
if isinstance(meta, str):
# Compatible with version 1.1.3 and below.
meta = json.loads(meta)
score = 1 - result.get("score", 0.0)
score = result.get("score", 0.0)
if score > score_threshold:
meta["score"] = score
doc = Document(page_content=result.get(self.field_text), metadata=meta)
docs.append(doc)

return docs

def delete(self) -> None:

Loading…
取消
儲存