From 425cb1d6bdd264c20de9d6c3618aeab0ff877658 Mon Sep 17 00:00:00 2001
From: DaGou12138 <991623169@qq.com>
Date: Fri, 8 May 2026 14:20:52 +0800
Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BC=98=E5=8C=96=E5=A4=A9?=
=?UTF-8?q?=E6=B0=94=E5=B7=A5=E5=85=B7=E8=B0=83=E7=94=A8=E6=8F=90=E7=A4=BA?=
=?UTF-8?q?=E8=AF=8D=EF=BC=8C=E6=9C=AC=E5=9C=B0=E4=B8=8A=E4=B8=8B=E6=96=87?=
=?UTF-8?q?=E5=AD=98=E5=9C=A8=E5=BD=93=E5=89=8D=E6=89=80=E5=9C=A8=E5=9C=B0?=
=?UTF-8?q?=E7=9A=84=E5=A4=A9=E6=B0=94=E4=BF=A1=E6=81=AF=E6=97=A0=E9=9C=80?=
=?UTF-8?q?=E5=86=8D=E5=BA=A6=E6=9F=A5=E8=AF=A2=E5=B7=A5=E5=85=B7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
main/xiaozhi-server/agent-base-prompt.txt | 6 ++++--
main/xiaozhi-server/plugins_func/functions/get_weather.py | 2 +-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/main/xiaozhi-server/agent-base-prompt.txt b/main/xiaozhi-server/agent-base-prompt.txt
index 5ea3484d..a2239a25 100644
--- a/main/xiaozhi-server/agent-base-prompt.txt
+++ b/main/xiaozhi-server/agent-base-prompt.txt
@@ -28,9 +28,11 @@ You are a playful, expressive, empathetic, and highly emotionally intelligent co
你有工具可用。只有用户的请求明确匹配以下工具时才调用,其余一律直接回答。
-必须调工具:播放音乐→play_music | 控制设备→hass工具 | 查新闻/天气→查询工具 | 告别→handle_exit_intent
+必须调工具:播放音乐→play_music | 控制设备→hass工具 | 查新闻→查询工具 | 告别→handle_exit_intent
+关于天气:上下文已提供本地未来7天天气,直接回答不调工具。仅问其他城市天气时才调get_weather。
禁止强行匹配:没有对应工具的请求一律直接回答,不要硬调不相关的工具。
该调不调也是错:用户说”放首歌”→你回答”好的我给你唱”(错!必须调play_music)
+不该调乱调也是错:用户问”明天天气”→调get_weather(错!上下文已有7天预报,直接回答)
@@ -54,4 +56,4 @@ You are a playful, expressive, empathetic, and highly emotionally intelligent co
-
+
\ No newline at end of file
diff --git a/main/xiaozhi-server/plugins_func/functions/get_weather.py b/main/xiaozhi-server/plugins_func/functions/get_weather.py
index a50f4129..88870529 100644
--- a/main/xiaozhi-server/plugins_func/functions/get_weather.py
+++ b/main/xiaozhi-server/plugins_func/functions/get_weather.py
@@ -18,7 +18,7 @@ GET_WEATHER_FUNCTION_DESC = {
"description": (
"获取某个地点的天气,用户应提供一个位置,比如用户说杭州天气,参数为:杭州。"
"如果用户说的是省份,默认用省会城市。如果用户说的不是省份或城市而是一个地名,默认用该地所在省份的省会城市。"
- "如果用户没有指明地点,说“天气怎么样”,”今天天气如何“,location参数为空"
+ "重要:本地未来7天天气已在上下文中提供,用户未指明其他城市时绝对不要调用此工具。"
),
"parameters": {
"type": "object",