From 17ac2ce0ed52874616c79c910667e41e34604826 Mon Sep 17 00:00:00 2001
From: wangzhibo <wangzhibo@shsening.com>
Date: 星期一, 31 八月 2026 13:14:12 +0800
Subject: [PATCH] add translation app
---
xiaozhi-esp32-server/main/xiaozhi-server/core/connection.py | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/xiaozhi-esp32-server/main/xiaozhi-server/core/connection.py b/xiaozhi-esp32-server/main/xiaozhi-server/core/connection.py
index 718f390..6e5f417 100644
--- a/xiaozhi-esp32-server/main/xiaozhi-server/core/connection.py
+++ b/xiaozhi-esp32-server/main/xiaozhi-server/core/connection.py
@@ -200,6 +200,16 @@
# 鏍囪褰撳墠鏄惁涓烘潵鐢垫帴鍚ā寮�
self.incoming_call = None
+ # Phase 1 App Runtime锛堣繛鎺ュ唴瀛橈紝涓嶅缓琛級
+ self.active_app_id = "chat"
+ self.current_task_id = "conversation"
+ self.interaction_mode = "CHAT"
+ self.current_source = "default_chat"
+ self.tool_policy = "inherit_agent"
+ self.tool_allowlist = []
+ self.original_system_prompt = None
+ self.awaiting_voice_app_choice = False
+
async def handle_connection(self, ws: websockets.ServerConnection):
try:
# 鑾峰彇杩愯涓殑浜嬩欢寰幆锛堝繀椤诲湪寮傛涓婁笅鏂囦腑锛�
@@ -649,6 +659,8 @@
self._init_prompt_enhancement()
"""娉ㄥ叆宸ュ叿璋冪敤few-shot绀轰緥锛堜粎function_call妯″紡锛�"""
self._inject_tool_call_fewshot()
+ if self.original_system_prompt is None:
+ self.original_system_prompt = self.prompt
except Exception as e:
self.logger.bind(tag=TAG).error(f"瀹炰緥鍖栫粍浠跺け璐�: {e}")
--
Gitblit v1.9.1