From 55add50a3e1b0bf3d4eba6eca209dae2f463846a Mon Sep 17 00:00:00 2001 From: hrz <1710360675@qq.com> Date: Thu, 13 Mar 2025 00:53:14 +0800 Subject: [PATCH] =?UTF-8?q?update:=E5=8E=BB=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/xiaozhi-server/config.yaml | 5 +++-- .../core/providers/intent/intent_llm/intent_llm.py | 13 ++++--------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/main/xiaozhi-server/config.yaml b/main/xiaozhi-server/config.yaml index a441930fb..da98f1b40 100644 --- a/main/xiaozhi-server/config.yaml +++ b/main/xiaozhi-server/config.yaml @@ -181,8 +181,9 @@ LLM: CozeLLM: # 定义LLM API类型 type: coze - bot_id: 你的bot_id - user_id: 你的user_id + # bot_id和user_id的内容写在引号之内 + bot_id: "你的bot_id" + user_id: "你的user_id" personal_access_token: 你的coze个人令牌 LMStudioLLM: # 定义LLM API类型 diff --git a/main/xiaozhi-server/core/providers/intent/intent_llm/intent_llm.py b/main/xiaozhi-server/core/providers/intent/intent_llm/intent_llm.py index bdcd3de51..04319438c 100644 --- a/main/xiaozhi-server/core/providers/intent/intent_llm/intent_llm.py +++ b/main/xiaozhi-server/core/providers/intent/intent_llm/intent_llm.py @@ -22,9 +22,9 @@ class IntentProvider(IntentProviderBase): intent_list = [] """ - # "continue_chat": "1.继续聊天, 除了播放音乐和结束聊天的时候的选项, 比如日常的聊天和问候, 对话等", - # "end_chat": "2.结束聊天, 用户发来如再见之类的表示结束的话, 不想再进行对话的时候", - # "play_music": "3.播放音乐, 用户希望你可以播放音乐, 只用于播放音乐的意图" + "continue_chat": "1.继续聊天, 除了播放音乐和结束聊天的时候的选项, 比如日常的聊天和问候, 对话等", + "end_chat": "2.结束聊天, 用户发来如再见之类的表示结束的话, 不想再进行对话的时候", + "play_music": "3.播放音乐, 用户希望你可以播放音乐, 只用于播放音乐的意图" """ for key, value in self.intent_options.items(): if key == "play_music": @@ -80,11 +80,6 @@ class IntentProvider(IntentProviderBase): # 构建用户最后一句话的提示 msgStr = "" - # for msg in dialogue_history: - # if msg.role == "user": - # msgStr += f"User: {msg.content}\n" - # elif msg.role== "assistant": - # msgStr += f"Assistant: {msg.content}\n" # 只使用最后两句即可 if len(dialogue_history) >= 2: @@ -95,7 +90,7 @@ class IntentProvider(IntentProviderBase): msgStr += f"User: {text}\n" user_prompt = f"当前的对话如下:\n{msgStr}" prompt_music = f"{self.promot}\n{conn.music_handler.music_files}\n" - # logger.bind(tag=TAG).info(f"User prompt: {prompt_music}") + logger.bind(tag=TAG).debug(f"User prompt: {prompt_music}") # 使用LLM进行意图识别 intent = self.llm.response_no_stream( system_prompt=prompt_music,