Przeglądaj źródła

Fix dify retrieval issue. (#4473)

### What problem does this PR solve?

#4464
#4469 

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.16.0
Kevin Hu 9 miesięcy temu
rodzic
commit
f556f0239c
No account linked to committer's email address
2 zmienionych plików z 2 dodań i 2 usunięć
  1. 1
    1
      api/apps/sdk/dify_retrieval.py
  2. 1
    1
      rag/app/manual.py

+ 1
- 1
api/apps/sdk/dify_retrieval.py Wyświetl plik

for c in ranks["chunks"]: for c in ranks["chunks"]:
c.pop("vector", None) c.pop("vector", None)
records.append({ records.append({
"content": c["content_ltks"],
"content": c["content_with_weight"],
"score": c["similarity"], "score": c["similarity"],
"title": c["docnm_kwd"], "title": c["docnm_kwd"],
"metadata": {} "metadata": {}

+ 1
- 1
rag/app/manual.py Wyświetl plik

for b in self.boxes: for b in self.boxes:
b["text"] = re.sub(r"([\t  ]|\u3000){2,}", " ", b["text"].strip()) b["text"] = re.sub(r"([\t  ]|\u3000){2,}", " ", b["text"].strip())


return [(b["text"], b.get("layout_no", ""), self.get_position(b, zoomin))
return [(b["text"], b.get("layoutno", ""), self.get_position(b, zoomin))
for i, b in enumerate(self.boxes)], tbls for i, b in enumerate(self.boxes)], tbls





Ładowanie…
Anuluj
Zapisz