diff --git a/CHANGELOG.md b/CHANGELOG.md index b14038fc75543491b07fbabe9f65e395963a8f7d..4558eaaf437c993311016fb0712d814591acd062 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ # 更新日志 +## [0.0.1-beta.3] - 2025.6.19 +### Changed +- 增加音乐兜底 +- 增加星座运势 + ## [0.0.1-beta.3] - 2025.6.6-6.14 ### Changed - 更改为redis存储sessionId diff --git a/c2c.http b/c2c.http index 571332af0fd70064e66e57e751cad925eaa5f689..0d6aad6405af1356acd6f55cf7c9e60c8c4b5336 100644 --- a/c2c.http +++ b/c2c.http @@ -5,7 +5,7 @@ Content-Type: application/json "ip": "14.215.222.17", "mac": "ece154a865eb", "mid": "11011", - "query":"你喜欢吃零食吗", + "query":"播放时政热点", "requestId": "123456111" } @@ -17,7 +17,7 @@ Content-Type: application/json "ip": "14.215.222.17", "mac": "ece154a865eb", "mid": "11011", - "query":"谁是你爸", + "query":"r", "requestId": "123456111" } @@ -38,7 +38,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": {} } @@ -57,7 +57,7 @@ Content-Type: application/json }, "nluRet": { "asr_recongize": "", - "text": "谁是你爸" + "text": "打开列表循环" } }, "version": "v0" @@ -79,7 +79,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/go.mod b/go.mod index a848c31f47d75739ae0b2606ff920f3d68dc7bb4..07f917877cb8601cd39554e73ac08d7a6062be41 100644 --- a/go.mod +++ b/go.mod @@ -15,6 +15,7 @@ require ( github.com/json-iterator/go v1.1.12 github.com/parnurzeal/gorequest v0.2.16 github.com/rabbitmq/amqp091-go v1.10.0 + github.com/soheilhy/cmux v0.1.5 github.com/spf13/viper v1.16.0 github.com/tidwall/gjson v1.14.4 go.uber.org/zap v1.24.0 @@ -60,7 +61,6 @@ require ( github.com/pelletier/go-toml/v2 v2.2.2 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/smartystreets/goconvey v1.8.0 // indirect - github.com/soheilhy/cmux v0.1.5 // indirect github.com/spf13/afero v1.9.5 // indirect github.com/spf13/cast v1.5.1 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect diff --git a/service/speechNlu/constant.go b/service/speechNlu/constant.go index 334565a2bf2bc6bd34175e64d9005d656228f01b..3df05263f5674691dd4105a076a5581ce36528de 100644 --- a/service/speechNlu/constant.go +++ b/service/speechNlu/constant.go @@ -89,9 +89,10 @@ const ( CONVERT = "单位换算" HOLIDAY = "节假日查询" //SLEEPMUSIC = "声音博物馆" - RELATION = "亲戚关系计算" - WASTESORTING = "垃圾分类" - FOOD = "食物营养查询" + RELATION = "亲戚关系计算" + WASTESORTING = "垃圾分类" + FOOD = "食物营养查询" + ASTRO_FORTUNE = "星座运势" SOUND = "sound" ALMANAC = "almanac" diff --git a/service/speechNlu/domain.go b/service/speechNlu/domain.go index 03a35b6b816e17e4c9d55e40ed1d48c63dd41987..9f204626c0db7cc03e22821352c0fdbfd83717e0 100644 --- a/service/speechNlu/domain.go +++ b/service/speechNlu/domain.go @@ -1073,6 +1073,25 @@ func childMusicDomain(params *model.SpeechDomainParams) []byte { return Marshal(params, res) } +func astroFortuneDomain(params *model.SpeechDomainParams) []byte { + res, err := baseParse(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("astroFortuneDomain baseParse error.") + return replyWithChat(error_reply, "doudi") + } + + res.Header.Semantic.Domain = "astro" + res.Header.Semantic.Intent = "search_fastfate" + res.Header.Semantic.SkillId = res.Header.Semantic.Domain + "." + res.Header.Semantic.Intent + + return Marshal(params, res) +} + func Marshal(params *model.SpeechDomainParams, res *model.ResponseBody) []byte { if res.Header.Semantic.Domain == "" { res.Header.Semantic.Domain = "chat" diff --git a/service/speechNlu/register.go b/service/speechNlu/register.go index f8c92d4ab2920394fdb333acd2991d7d328c644d..283bcda7734bc66da30506b242470fa0d409f60b 100644 --- a/service/speechNlu/register.go +++ b/service/speechNlu/register.go @@ -52,6 +52,7 @@ func register() { DomainRegister(RELATION, speechOtherDomain) DomainRegister(WASTESORTING, speechOtherDomain) DomainRegister(FOOD, speechOtherDomain) + DomainRegister(ASTRO_FORTUNE, astroFortuneDomain) DomainRegister("", speechOtherDomain) //