From fa32a2d0fdb9a3d641fba4069d05a1aa68d6bd32 Mon Sep 17 00:00:00 2001 From: duramisu Date: Wed, 7 May 2025 16:05:40 +0800 Subject: [PATCH] Fix:When sharing the knowledge base of multiple tenants with one person, when this person queries the knowledge base of both tenants, they will only query the question of the first person's knowledge base (#7500) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix:When sharing the knowledge base of multiple tenants with one person, when this person queries the knowledge base of both tenants, they will only query the question of the first person's knowledge base Co-authored-by: 杜有强 --- api/apps/sdk/doc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/apps/sdk/doc.py b/api/apps/sdk/doc.py index eb0110b8f..5f05cca14 100644 --- a/api/apps/sdk/doc.py +++ b/api/apps/sdk/doc.py @@ -1407,6 +1407,7 @@ def retrieval_test(tenant_id): else: highlight = True try: + tenant_ids = list(set([kb.tenant_id for kb in kbs])) e, kb = KnowledgebaseService.get_by_id(kb_ids[0]) if not e: return get_error_data_result(message="Dataset not found!") @@ -1423,7 +1424,7 @@ def retrieval_test(tenant_id): ranks = settings.retrievaler.retrieval( question, embd_mdl, - kb.tenant_id, + tenant_ids, kb_ids, page, size,