From 659c470eba542383987aad227b7f918100f131fa Mon Sep 17 00:00:00 2001
From: wangzhibo <wangzhibo@shsening.com>
Date: 星期五, 11 九月 2026 15:09:05 +0800
Subject: [PATCH] 小智终端 5种 场景模式 OK

---
 xiaozhi-esp32-server/main/xiaozhi-server/plugins_func/functions/switch_app.py |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/xiaozhi-esp32-server/main/xiaozhi-server/plugins_func/functions/switch_app.py b/xiaozhi-esp32-server/main/xiaozhi-server/plugins_func/functions/switch_app.py
index 7282138..63993f1 100644
--- a/xiaozhi-esp32-server/main/xiaozhi-server/plugins_func/functions/switch_app.py
+++ b/xiaozhi-esp32-server/main/xiaozhi-server/plugins_func/functions/switch_app.py
@@ -9,14 +9,23 @@
     "type": "function",
     "function": {
         "name": "switch_app",
-        "description": "鍒囨崲璁惧褰撳墠 App銆傛墦寮�缈昏瘧銆佹墦寮�鑻辫瀛︿範/澶嶈銆佸洖鍒拌亰澶┿�侀��鍑虹炕璇戞椂璋冪敤銆俛pp_id 鍙兘鏄� chat銆乪nglish_learning銆乪nglish_translation銆�",
+        "description": (
+            "鍒囨崲璁惧褰撳墠 App銆�"
+            "chat=瀵硅瘽锛沞nglish_translation=缈昏瘧锛沞nglish_conversation=涓嫳瀵硅瘽锛�"
+            "english_learning 闇�閰嶅悎 task_id锛歳epeater=澶嶈鏈猴紝shadowing=璺熻銆�"
+            "閫�鍑哄綋鍓嶆ā寮忋�佸洖鍒拌亰澶╂椂 app_id=chat銆�"
+        ),
         "parameters": {
             "type": "object",
             "properties": {
                 "app_id": {
                     "type": "string",
-                    "description": "鐩爣 App锛歝hat锛堣亰澶╋級銆乪nglish_learning锛堝璇伙級銆乪nglish_translation锛堢炕璇戯級",
-                }
+                    "description": "chat銆乪nglish_learning銆乪nglish_translation銆乪nglish_conversation",
+                },
+                "task_id": {
+                    "type": "string",
+                    "description": "鍙�夈�俥nglish_learning 涓� repeater 鎴� shadowing锛涘叾瀹� App 鍙┖",
+                },
             },
             "required": ["app_id"],
         },
@@ -25,10 +34,10 @@
 
 
 @register_function("switch_app", switch_app_function_desc, ToolType.SYSTEM_CTL)
-async def switch_app(conn: "ConnectionHandler", app_id: str):
+async def switch_app(conn: "ConnectionHandler", app_id: str, task_id: str = ""):
     from core.app_runtime.runtime import switch_app as runtime_switch
 
-    result = await runtime_switch(conn, app_id, source="voice")
+    result = await runtime_switch(conn, app_id, source="voice", task_id=task_id or "")
     if result.action == Action.ERROR:
         return ActionResponse(
             action=Action.RESPONSE,

--
Gitblit v1.9.1