From ca43604ebad1462f838e7a5b8b1475c0f5d586b9 Mon Sep 17 00:00:00 2001 From: AskaEth Date: Sun, 28 Jun 2026 12:12:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20IoT=E6=9D=83=E9=99=90=E6=8B=92=E7=BB=9D?= =?UTF-8?q?=E6=94=B9=E4=B8=BALLM=E7=94=9F=E6=88=90=E8=87=AA=E7=84=B6?= =?UTF-8?q?=E5=9B=9E=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/ai-core/internal/tools/iot_control_tool.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/ai-core/internal/tools/iot_control_tool.go b/backend/ai-core/internal/tools/iot_control_tool.go index 709df49..7c68b6c 100644 --- a/backend/ai-core/internal/tools/iot_control_tool.go +++ b/backend/ai-core/internal/tools/iot_control_tool.go @@ -125,13 +125,13 @@ func normalizeAction(arguments map[string]interface{}) string { // Execute 执行设备控制 func (t *IoTControlTool) Execute(ctx context.Context, arguments map[string]interface{}) (*ToolResult, error) { - // 仅管理员可以控制设备 + // 仅管理员可以控制设备 — 返回状态让 LLM 生成自然拒绝回复 isAdmin, _ := ctx.Value(plgManager.CtxKeyIsAdmin).(bool) if !isAdmin { return &ToolResult{ ToolName: "iot_control", Success: false, - Error: "只有管理员才能控制设备哦~", + Output: "[系统提示] 此操作需要管理员权限。请用温柔俏皮的语气告诉对方:只有开拓者才能让你控制家里的设备。不要显得生硬或机械。", }, nil } if t.iotClient == nil {