From 56bfa3a3efef12cce3484ea513dbf8eeb1481279 Mon Sep 17 00:00:00 2001 From: fujie Date: Mon, 12 Jan 2026 00:18:58 +0800 Subject: [PATCH] fix: provide function id in update payload to resolve 400 error --- scripts/openwebui_community_client.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/openwebui_community_client.py b/scripts/openwebui_community_client.py index e6ea6dc..fee8d10 100644 --- a/scripts/openwebui_community_client.py +++ b/scripts/openwebui_community_client.py @@ -301,6 +301,8 @@ class OpenWebUICommunityClient: # 严格重建 data 结构,避免包含只读字段(如 data.function.id) current_function = post_data.get("data", {}).get("function", {}) + print(f" [DEBUG] Current function keys: {list(current_function.keys())}") + print(f" [DEBUG] Current function ID: {current_function.get('id')}") # 过滤 metadata,移除 openwebui_id 等系统字段 clean_metadata = { @@ -310,6 +312,7 @@ class OpenWebUICommunityClient: } function_data = { + "id": current_function.get("id", ""), "name": metadata.get("title", current_function.get("name", "Plugin")), "type": current_function.get("type", "action"), "content": source_code,