RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
Fix: refine error msg. (#11380)
Kevin Huc43bf1dcf549
diff --git a/admin/server/auth.py b/admin/server/auth.pyindex 58a900afde..6c8bc2cb85 100644--- a/admin/server/auth.py+++ b/admin/server/auth.py@@ -31,7 +31,7 @@ from common.constants import ActiveEnum, StatusEnumfrom api.utils.crypt import decryptfrom common.misc_utils import get_uuidfrom common.time_utils import current_timestamp, datetime_format, get_format_time-from common.connection_utils import construct_response+from common.connection_utils import sync_construct_responsefrom common import settings@@ -130,7 +130,7 @@ def login_admin(email: str, password: str):user.last_login_time = get_format_time()user.save()msg = "Welcome back!"- return construct_response(data=resp, auth=user.get_id(), message=msg)+ return sync_construct_response(data=resp, auth=user.get_id(), message=msg)def check_admin(username: str, password: str):diff --git a/api/apps/kb_app.py b/api/apps/kb_app.pyindex 94cb8cf5b1..4e8015d7fb 100644--- a/api/apps/kb_app.py+++ b/api/apps/kb_app.py@@ -886,6 +886,7 @@ async def check_embedding():try:v, _ = emb_mdl.encode([title, txt_in])+ assert len(v[1]) == len(ck["vector"]), f"The dimension ({len(v[1])}) of given embedding model is different from the original ({len(ck['vector'])})"sim_content = _cos_sim(v[1], ck["vector"])title_w = 0.1qv_mix = title_w * v[0] + (1 - title_w) * v[1]@@ -895,8 +896,8 @@ async def check_embedding():if sim_mix > sim:sim = sim_mixmode = "title+content"- except Exception:- return get_error_data_result(message="embedding failure")+ except Exception as e:+ return get_error_data_result(message=f"Embedding failure. {e}")eff_sims.append(sim)results.append({diff --git a/common/connection_utils.py b/common/connection_utils.pyindex 0f765d57e9..5b8154f0ce 100644--- a/common/connection_utils.py+++ b/common/connection_utils.py@@ -120,3 +120,23 @@ async def construct_response(code=RetCode.SUCCESS, message="success", data=None,response.headers["Access-Control-Allow-Headers"] = "*"response.headers["Access-Control-Expose-Headers"] = "Authorization"return response+++def sync_construct_response(code=RetCode.SUCCESS, message="success", data=None, auth=None):+ import flask+ result_dict = {"code": code, "message": message, "data": data}+ response_dict = {}+ for key, value in result_dict.items():+ if value is None and key != "code":+ continue+ else:+ response_dict[key] = value+ response = flask.make_response(flask.jsonify(response_dict))+ if auth:+ response.headers["Authorization"] = auth+ response.headers["Access-Control-Allow-Origin"] = "*"+ response.headers["Access-Control-Allow-Method"] = "*"+ response.headers["Access-Control-Allow-Headers"] = "*"+ response.headers["Access-Control-Allow-Headers"] = "*"+ response.headers["Access-Control-Expose-Headers"] = "Authorization"+ return responsediff --git a/conf/llm_factories.json b/conf/llm_factories.jsonindex 0eefa7a144..71f47be2e5 100644--- a/conf/llm_factories.json+++ b/conf/llm_factories.json@@ -4848,7 +4848,7 @@]},{- "name": "JieKou.AI",+ "name": "Jiekou.AI","logo": "","tags": "LLM,TEXT EMBEDDING,TEXT RE-RANK","status": "1",