mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Feat: let image citation being shown. (#7624)
### What problem does this PR solve? #7623 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -117,7 +117,9 @@ def kb_prompt(kbinfos, max_tokens):
|
||||
|
||||
doc2chunks = defaultdict(lambda: {"chunks": [], "meta": []})
|
||||
for i, ck in enumerate(kbinfos["chunks"][:chunks_num]):
|
||||
doc2chunks[ck["docnm_kwd"]]["chunks"].append((f"URL: {ck['url']}\n" if "url" in ck else "") + f"ID: {i}\n" + ck["content_with_weight"])
|
||||
cnt = f"---\nID: {i}\n" + (f"URL: {ck['url']}\n" if "url" in ck else "")
|
||||
cnt += ck["content_with_weight"]
|
||||
doc2chunks[ck["docnm_kwd"]]["chunks"].append(cnt)
|
||||
doc2chunks[ck["docnm_kwd"]]["meta"] = docs.get(ck["doc_id"], {})
|
||||
|
||||
knowledges = []
|
||||
|
||||
Reference in New Issue
Block a user