From c4f43a395d4e1cdb89160439f80efe32c55a1502 Mon Sep 17 00:00:00 2001 From: Kevin Hu Date: Tue, 9 Sep 2025 10:52:18 +0800 Subject: [PATCH] Fix: re sub error. (#9985) ### What problem does this PR solve? ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- agent/component/llm.py | 2 +- api/utils/api_utils.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/agent/component/llm.py b/agent/component/llm.py index 7f1f2eb36..b13c4a87e 100644 --- a/agent/component/llm.py +++ b/agent/component/llm.py @@ -160,7 +160,7 @@ class LLM(ComponentBase): if not r: continue pts[tag.lower()] = r.group(1) - sys_prompt = re.sub(rf"<{tag}>(.*?)", sys_prompt, flags=re.DOTALL|re.IGNORECASE) + sys_prompt = re.sub(rf"<{tag}>(.*?)", "", sys_prompt, flags=re.DOTALL|re.IGNORECASE) return pts, sys_prompt def _generate(self, msg:list[dict], **kwargs) -> str: diff --git a/api/utils/api_utils.py b/api/utils/api_utils.py index 30cf12aae..c66347d3e 100644 --- a/api/utils/api_utils.py +++ b/api/utils/api_utils.py @@ -320,6 +320,8 @@ def construct_error_response(e): def token_required(func): @wraps(func) def decorated_function(*args, **kwargs): + if os.environ.get("DISABLE_SDK"): + return get_json_result(data=False, message="`Authorization` can't be empty") authorization_str = flask_request.headers.get("Authorization") if not authorization_str: return get_json_result(data=False, message="`Authorization` can't be empty")