Fix: retrieval component for shared KB issue. (#7513)

### What problem does this PR solve?

#7483

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Kevin Hu 2025-05-08 09:20:34 +08:00 committed by GitHub
parent e300d90c00
commit 7b57ab5dea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -97,7 +97,7 @@ class Retrieval(ComponentBase, ABC):
kbinfos = settings.retrievaler.retrieval(
query,
embd_mdl,
kbs[0].tenant_id,
[kb.tenant_id for kb in kbs],
filtered_kb_ids,
1,
self._param.top_n,
@ -111,7 +111,7 @@ class Retrieval(ComponentBase, ABC):
kbinfos = {"chunks": [], "doc_aggs": []}
if self._param.use_kg and kbs:
ck = settings.kg_retrievaler.retrieval(query, [kbs[0].tenant_id], filtered_kb_ids, embd_mdl, LLMBundle(kbs[0].tenant_id, LLMType.CHAT))
ck = settings.kg_retrievaler.retrieval(query, [kb.tenant_id for kb in kbs], filtered_kb_ids, embd_mdl, LLMBundle(kbs[0].tenant_id, LLMType.CHAT))
if ck["content_with_weight"]:
kbinfos["chunks"].insert(0, ck)