From 3dca8b4b3e7788e93e8ba851f2dd39d785dc20eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=96=87=E9=9D=99?= <1319697849@qq.com> Date: Fri, 16 May 2025 10:50:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/models.go | 2 +- service/speechNlu/domain.go | 1 + service/speechNlu/speechWs.go | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/model/models.go b/model/models.go index e6d969e..6290550 100644 --- a/model/models.go +++ b/model/models.go @@ -270,7 +270,7 @@ type ResponseBody struct { } `json:"header"` ResponseText string `json:"response_text"` AsrRecongize string `json:"asr_recongize"` - ListItems []map[string]interface{} `json:"listItems"` + ListItems []map[string]interface{} `json:"listItems,omitempty"` } type SDKExtend struct { diff --git a/service/speechNlu/domain.go b/service/speechNlu/domain.go index 76c8ee3..0f9b2e2 100644 --- a/service/speechNlu/domain.go +++ b/service/speechNlu/domain.go @@ -51,6 +51,7 @@ func baseParse(params *model.SpeechDomainParams) (*model.ResponseBody, error) { //result.Header.Semantic.SkillId = result.Header.Semantic.Domain + "." + result.Header.Semantic.Intent 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) UpdateSession(params.Mac, params.SpeechWsResp.SessionId) diff --git a/service/speechNlu/speechWs.go b/service/speechNlu/speechWs.go index 96d8991..069606d 100644 --- a/service/speechNlu/speechWs.go +++ b/service/speechNlu/speechWs.go @@ -76,6 +76,10 @@ func SpeechNlpWsReq(data *model.SemanticReq, sessionId string) *SpeechWsData { req.SessionId = sessionId req.RefText = data.Query log.Printf("请求的sessionId: %s", req.SessionId) + global.Logger.WithFields(logger.Fields{ + "req": req, + "sessionId": sessionId, + }).Error("SpeechNlpWsReq") return req } -- GitLab