Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
speech_nlu_parse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵文静
speech_nlu_parse
Commits
293deb54
Commit
293deb54
authored
May 23, 2025
by
赵文静
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改新闻
parent
2bf675ef
Pipeline
#5270
passed with stage
in 0 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
53 deletions
+26
-53
c2c.http
c2c.http
+4
-4
service/speechNlu/domain.go
service/speechNlu/domain.go
+22
-49
No files found.
c2c.http
View file @
293deb54
...
...
@@ -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": {}
}
...
...
@@ -28,12 +28,12 @@ Content-Type: application/json
"reqParam": {
"common": {
"remoteIP": "14.215.222.17",
"requestId": "12345681231231181
11
",
"requestId": "12345681231231181
29
",
"trafficParameter": "ver=3.0;scenario=smarthome;filterName=nlu2;req_nlu_length=2;returnType=json;fullDuplex=true;appendLength=1;additionalService=geli_nlu;mid=11011;version=0.5;macWifi=28b77c23817b1234111111;macVoice=28b77c23817b1234111111"
},
"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": {}
}
...
...
service/speechNlu/domain.go
View file @
293deb54
...
...
@@ -52,10 +52,11 @@ func baseParse(params *model.SpeechDomainParams) (*model.ResponseBody, error) {
result
.
ResponseText
=
params
.
SpeechWsResp
.
Dm
.
Nlg
result
.
AsrRecongize
=
params
.
SpeechWsResp
.
Dm
.
Input
//result.ListItems = make([]map[string]interface{}, 0)
if
!
params
.
SpeechWsResp
.
Dm
.
ShouldEndSession
{
fmt
.
Println
(
"保存:"
,
params
.
SpeechWsResp
.
SessionId
)
//if !params.SpeechWsResp.Dm.ShouldEndSession {
// fmt.Println("保存:", params.SpeechWsResp.SessionId)
// UpdateSession(params.Mac, params.SpeechWsResp.SessionId)
//}
UpdateSession
(
params
.
Mac
,
params
.
SpeechWsResp
.
SessionId
)
}
return
&
result
,
nil
}
...
...
@@ -448,14 +449,6 @@ func alarmDomain(params *model.SpeechDomainParams) []byte {
"vender"
:
params
.
MidType
,
})
.
Errorf
(
"json.Unmarshal error: %v"
,
err
)
}
if
len
(
extraParam
.
Content
)
>
0
{
var
content
map
[
string
]
interface
{}
if
err
:=
json
.
Unmarshal
(
extraParam
.
Content
,
&
content
);
err
==
nil
{
if
len
(
content
)
==
0
{
return
Marshal
(
params
,
&
result
)
}
}
}
if
object
==
"闹钟"
{
result
.
Header
.
Semantic
.
Domain
=
"alarm"
...
...
@@ -465,49 +458,28 @@ func alarmDomain(params *model.SpeechDomainParams) []byte {
if
api
==
"ai.dui.dskdm.reminder.query"
{
result
.
Header
.
Semantic
.
Intent
=
"check"
result
.
Header
.
Semantic
.
SkillId
=
result
.
Header
.
Semantic
.
Domain
+
"."
+
result
.
Header
.
Semantic
.
Intent
}
else
if
api
==
"ai.dui.dskdm.reminder.insert"
{
result
.
Header
.
Semantic
.
Intent
=
"new"
result
.
Header
.
Semantic
.
SkillId
=
result
.
Header
.
Semantic
.
Domain
+
"."
+
result
.
Header
.
Semantic
.
Intent
resAlarm
,
err
:=
connect
.
AlarmGrpc
(
params
,
api
,
extra
,
object
)
if
err
!=
nil
{
global
.
Logger
.
WithFields
(
logger
.
Fields
{
"requestId"
:
params
.
RequestId
,
"mac"
:
params
.
Mac
,
"mid"
:
params
.
Mid
,
"vender"
:
params
.
MidType
,
})
.
Errorf
(
"connect.AlarmGrpc error:%v"
,
err
)
return
replyWithChat
(
error_reply
,
"doudi"
)
}
if
resAlarm
.
GetStatus
()
.
GetCode
()
==
0
{
return
Marshal
(
params
,
&
result
)
}
else
{
resultTextStr
:=
"网络不稳定,请稍后再试"
return
replyWithChat
(
resultTextStr
,
"chat.chat"
)
}
}
else
if
api
==
"ai.dui.dskdm.reminder.remove"
{
result
.
Header
.
Semantic
.
Intent
=
"delete"
result
.
Header
.
Semantic
.
SkillId
=
result
.
Header
.
Semantic
.
Domain
+
"."
+
result
.
Header
.
Semantic
.
Intent
resAlarm
,
err
:=
connect
.
AlarmGrpc
(
params
,
api
,
extra
,
object
)
if
err
!=
nil
{
global
.
Logger
.
WithFields
(
logger
.
Fields
{
"requestId"
:
params
.
RequestId
,
"mac"
:
params
.
Mac
,
"mid"
:
params
.
Mid
,
"vender"
:
params
.
MidType
,
})
.
Errorf
(
"connect.AlarmGrpc error:%v"
,
err
)
return
replyWithChat
(
error_reply
,
"doudi"
)
}
if
resAlarm
.
GetStatus
()
.
GetCode
()
==
0
{
return
Marshal
(
params
,
&
result
)
}
else
{
resultTextStr
:=
"网络不稳定,请稍后再试"
return
replyWithChat
(
resultTextStr
,
"chat.chat"
)
}
}
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
if
len
(
extraParam
.
Content
)
>
0
{
var
content
map
[
string
]
interface
{}
if
err
:=
json
.
Unmarshal
(
extraParam
.
Content
,
&
content
);
err
==
nil
{
if
len
(
content
)
==
0
{
return
Marshal
(
params
,
&
result
)
}
}
}
if
api
==
"ai.dui.dskdm.reminder.query"
{
//result.Header.Semantic.Intent = "check"
//result.Header.Semantic.SkillId = result.Header.Semantic.Domain + "." + result.Header.Semantic.Intent
}
else
if
api
==
"ai.dui.dskdm.reminder.insert"
||
api
==
"ai.dui.dskdm.reminder.remove"
||
api
==
"ai.dui.dskdm.reminder.shut"
{
resAlarm
,
err
:=
connect
.
AlarmGrpc
(
params
,
api
,
extra
,
object
)
if
err
!=
nil
{
global
.
Logger
.
WithFields
(
logger
.
Fields
{
...
...
@@ -524,6 +496,7 @@ func alarmDomain(params *model.SpeechDomainParams) []byte {
resultTextStr
:=
"网络不稳定,请稍后再试"
return
replyWithChat
(
resultTextStr
,
"chat.chat"
)
}
}
//
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment