From 5ca41ec915fba050e8265b706697cc5c39332a44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=96=87=E9=9D=99?= <1319697849@qq.com> Date: Thu, 29 May 2025 14:09:58 +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 | 5 +++++ c2c.http | 6 +++--- service/speechNlu/domain.go | 20 +++++++++++++------- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 203ecb3..ad75bcb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ # 更新日志 +## [0.0.1-beta.2] - 2025.5.29 +### Changed +- 补充诗词解析兜底 +- 暂停闹钟直接返回解析给整机处理 + ## [0.0.1-beta] - 2025.5.13 ### Changed - 对接思必驰 diff --git a/c2c.http b/c2c.http index b9ecf7f..6058c45 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": "暂停闹钟" }, "postProc": {} } @@ -33,7 +33,7 @@ Content-Type: application/json }, "nluRet": { "asr_recongize": "", - "text": "关闭提醒" + "text": "城春草木深下一句" } }, "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": "后天天气" }, "postProc": {} } diff --git a/service/speechNlu/domain.go b/service/speechNlu/domain.go index 9a7ff38..f833b70 100644 --- a/service/speechNlu/domain.go +++ b/service/speechNlu/domain.go @@ -247,13 +247,16 @@ func ancientpoemDomain(params *model.SpeechDomainParams) []byte { if params.SpeechWsResp.Dm.IntentName == "查询诗词释义" { res.Header.Semantic.Intent = "search_ancientpoem_meaning" - res.ListItems = append(res.ListItems, map[string]interface{}{ - "content": params.SpeechWsResp.Dm.Widget.Extra.ContentTranslation, - "title": params.SpeechWsResp.Dm.Widget.Extra.Title, - "type": "TEXT", //原来是 TEXT,看看是否能播放 - "url": "", - "mediaId": "", - }) + if params.SpeechWsResp.Dm.Widget.Extra.ContentTranslation == "" { //如果返回列表,整机是播放content里的消息 + } else { + res.ListItems = append(res.ListItems, map[string]interface{}{ + "content": params.SpeechWsResp.Dm.Widget.Extra.ContentTranslation, + "title": params.SpeechWsResp.Dm.Widget.Extra.Title, + "type": "TEXT", //原来是 TEXT,看看是否能播放 + "url": "", + "mediaId": "", + }) + } res.Header.Semantic.SkillId = res.Header.Semantic.Domain + "." + res.Header.Semantic.Intent return Marshal(params, res) } else if params.SpeechWsResp.Dm.IntentName == "查询诗句" { @@ -464,6 +467,9 @@ func alarmDomain(params *model.SpeechDomainParams) []byte { result.Header.Semantic.Intent = "delete" } else if api == "ai.dui.dskdm.reminder.shut" { result.Header.Semantic.Intent = "stop" + result.Header.Semantic.SkillId = result.Header.Semantic.Domain + "." + result.Header.Semantic.Intent + result.ResponseText = "好的。" + return Marshal(params, &result) } result.Header.Semantic.SkillId = result.Header.Semantic.Domain + "." + result.Header.Semantic.Intent -- GitLab