From 6bc22f77870694bcf44b060b0c19638b6354de3d 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:34:43 +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 --- c2c.http | 4 ++-- service/speechNlu/domain.go | 24 +++++++++++++++++------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/c2c.http b/c2c.http index 6058c45..9166f91 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" diff --git a/service/speechNlu/domain.go b/service/speechNlu/domain.go index f833b70..d05bb4f 100644 --- a/service/speechNlu/domain.go +++ b/service/speechNlu/domain.go @@ -244,24 +244,34 @@ func ancientpoemDomain(params *model.SpeechDomainParams) []byte { res.Header.Semantic.Domain = "ancient_poem" res.Header.Semantic.Intent = "search_tangshi" + var content string if params.SpeechWsResp.Dm.IntentName == "查询诗词释义" { res.Header.Semantic.Intent = "search_ancientpoem_meaning" if params.SpeechWsResp.Dm.Widget.Extra.ContentTranslation == "" { //如果返回列表,整机是播放content里的消息 + content = params.SpeechWsResp.Dm.Nlg } 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": "", - }) + content = params.SpeechWsResp.Dm.Widget.Extra.ContentTranslation } + res.ListItems = append(res.ListItems, map[string]interface{}{ + "content": content, + "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 == "查询诗句" { res.Header.Semantic.Intent = "search_ancientpoem_chains" res.Header.Semantic.SkillId = res.Header.Semantic.Domain + "." + res.Header.Semantic.Intent + res.ListItems = append(res.ListItems, map[string]interface{}{ + "content": params.SpeechWsResp.Dm.Nlg, + "title": params.SpeechWsResp.Dm.Widget.Extra.Title, + "type": "TEXT", //原来是 TEXT,看看是否能播放 + "url": "", + "mediaId": "", + }) return Marshal(params, res) } -- GitLab