From 61abe207b8f5ffccc656993d039bfde446c86938 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=96=87=E9=9D=99?= <1319697849@qq.com> Date: Tue, 3 Jun 2025 11:14:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + c2c.http | 6 +++--- service/speechNlu/domain.go | 5 ++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad75bcb..6db64cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ### Changed - 补充诗词解析兜底 - 暂停闹钟直接返回解析给整机处理 +- 补充闹钟兜底回复为第三方回复 ## [0.0.1-beta] - 2025.5.13 ### Changed diff --git a/c2c.http b/c2c.http index 9166f91..69f82db 100644 --- a/c2c.http +++ b/c2c.http @@ -14,7 +14,7 @@ Content-Type: application/json "trafficParameter": "mode=childxxx;macWifi=28b77c218ed1;mid=10f05;vender=7e000025;macVoice=testyuntiancloud;ver=3.0;scenario=smarthome;filterName=nlu;req_nlu_length=1;returnType=json;fullDuplex=true;appendLength=1;additionalService=geli_nlu2;version=0.5;filterUrl=https://testnlu.gree.com:443/semantic/unisoundc2c/querys;" }, "nluRet": { - "text": "城春草木深下一句" + "text": "设一个昨天5点的闹钟" }, "postProc": {} } @@ -33,7 +33,7 @@ Content-Type: application/json }, "nluRet": { "asr_recongize": "", - "text": "春望的释义" + "text": "设置一个昨天5点的闹钟" } }, "version": "v0" @@ -55,7 +55,7 @@ Content-Type: application/json "trafficParameter": "mode=childxx;macWifi=ece154a73d38;mid=11011;macVoice=testyuntiancloud;ver=3.0;scenario=smarthome;filterName=nlu;req_nlu_length=1;returnType=json;fullDuplex=true;appendLength=1;additionalService=geli_nlu2;version=0.5;filterUrl=https://testnlu.gree.com:443/semantic/unisoundc2c/querys;" }, "nluRet": { - "text": "后天天气" + "text": "设置一个昨天5点的闹钟" }, "postProc": {} } diff --git a/service/speechNlu/domain.go b/service/speechNlu/domain.go index d05bb4f..1361b33 100644 --- a/service/speechNlu/domain.go +++ b/service/speechNlu/domain.go @@ -447,6 +447,9 @@ func alarmDomain(params *model.SpeechDomainParams) []byte { } if !params.CheckDm() || !params.CheckCommandParam() { + if result.ResponseText != "" { + return Marshal(params, &result) + } return replyWithChat(error_reply, "doudi") } api := params.SpeechWsResp.Dm.Command.Api @@ -1074,7 +1077,7 @@ func Marshal(params *model.SpeechDomainParams, res *model.ResponseBody) []byte { res.Header.Semantic.Domain = "chat" } if res.Header.Semantic.Intent == "" { - res.Header.Semantic.Domain = "chat" + res.Header.Semantic.Intent = "chat" } resByte, err := json.Marshal(res) if err != nil { -- GitLab