Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Fix: When List Kbs some times the total is wrong (#8151)

Stephen Hue6f68e1ccf35
diff --git a/api/apps/kb_app.py b/api/apps/kb_app.py
index 3971dfdf0e..520da91e33 100644
--- a/api/apps/kb_app.py
+++ b/api/apps/kb_app.py
@@ -185,9 +185,9 @@ def list_kbs():
tenants, current_user.id, 0,
0, orderby, desc, keywords, parser_id)
kbs = [kb for kb in kbs if kb["tenant_id"] in tenants]
+ total = len(kbs)
if page_number and items_per_page:
kbs = kbs[(page_number-1)*items_per_page:page_number*items_per_page]
- total = len(kbs)
return get_json_result(data={"kbs": kbs, "total": total})
except Exception as e:
return server_error_response(e)