From bc21ecd1ecd8f119daa5cf378acbbfd5dba5b427 Mon Sep 17 00:00:00 2001 From: WJG Date: Tue, 11 Jun 2024 21:32:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=94=A4=E9=86=92?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E4=B8=8B=E9=87=8D=E6=96=B0=E5=8C=B9=E9=85=8D?= =?UTF-8?q?=E5=94=A4=E9=86=92=E8=AF=8D=E6=97=B6=EF=BC=8C=E4=B8=8D=E5=86=8D?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E5=94=A4=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/todo.md | 12 +++++++----- src/services/speaker/ai.ts | 8 ++++++-- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/docs/todo.md b/docs/todo.md index 3252426..d479979 100644 --- a/docs/todo.md +++ b/docs/todo.md @@ -4,11 +4,11 @@ ## 🔥 Hotfix +- ✅ 修复对 Azure OpenAI Service 的支持 - ✅ 修复 MIoT 和 Mina 接口查询到的设备名称不一致的问题。https://github.com/idootop/mi-gpt/issues/62 -- ✅ 提示语列表为空,或提示语和提示音链接都为空时,不播放提示音。https://github.com/idootop/mi-gpt/issues/30#issuecomment-2153786207 -- 修复唤醒模式下,重新匹配唤醒词时,应该走询问 AI 的流程。([issues#25](https://github.com/idootop/mi-gpt/issues/25)) +- ✅ 提示语列表为空时,不播放提示音。https://github.com/idootop/mi-gpt/issues/30#issuecomment-2153786207 +- ✅ 唤醒模式下重新匹配唤醒词时,不再重复唤醒。https://github.com/idootop/mi-gpt/issues/25 - ✅ 修复使用提示音链接时,小爱回答完毕后,仍然重复播放文字提示语的问题。 -- 优化网络请求错误重试策略(消息/播放状态轮询) ## 💪 优化 @@ -51,9 +51,11 @@ ## ✨ 新功能 - 支持火山引擎 TTS 和音色切换能力 -- 开放 System Prompt 自定义能力 +- 开放自定义 System Prompt 能力 - 添加更详细的使用和配置视频教程 ## 💪 优化 -- 添加常见小爱音箱型号的支持情况和参数列表。 +- 优化网络请求错误重试策略(消息/播放状态轮询) +- 添加常见小爱音箱型号的支持情况和参数列表 +- 【待定】使用通知事件获取最新消息和设备播放状态 diff --git a/src/services/speaker/ai.ts b/src/services/speaker/ai.ts index dc93b62..0a089ca 100644 --- a/src/services/speaker/ai.ts +++ b/src/services/speaker/ai.ts @@ -166,13 +166,17 @@ export class AISpeaker extends Speaker { get commands() { return [ { - match: (msg) => this.wakeUpKeywords.some((e) => msg.text.includes(e)), + match: (msg) => + !this.keepAlive && + this.wakeUpKeywords.some((e) => msg.text.startsWith(e)), run: async (msg) => { await this.enterKeepAlive(); }, }, { - match: (msg) => this.exitKeywords.some((e) => msg.text.includes(e)), + match: (msg) => + this.keepAlive && + this.exitKeywords.some((e) => msg.text.startsWith(e)), run: async (msg) => { await this.exitKeepAlive(); },