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)

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: 杜有强 <duyq@internal.ths.com.cn>
This commit is contained in:
duramisu 2025-05-07 16:05:40 +08:00 committed by GitHub
parent 27ffc0ed74
commit fa32a2d0fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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,