-
Notifications
You must be signed in to change notification settings - Fork 1
/
response.go
37 lines (34 loc) · 1019 Bytes
/
response.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package amivoice
type UEvent struct {
Results []struct {
Tokens []struct {
Written string `json:"written"`
} `json:"tokens"`
Text string `json:"text"`
} `json:"results"`
Text string `json:"text"`
}
type AEvent struct {
Results []struct {
Tokens []struct {
Written string `json:"written"`
Confidence float64 `json:"confidence"`
StartTime int `json:"starttime"`
EndTime int `json:"endtime"`
Spoken string `json:"spoken"`
} `json:"tokens"`
Confidence float64 `json:"confidence"`
StartTime int `json:"starttime"`
EndTime int `json:"endtime"`
Tags []interface{} `json:"tags"`
RuleName string `json:"rulename"`
Text string `json:"text"`
} `json:"results"`
UtteranceID string `json:"utteranceid"`
Text string `json:"text"`
Code string `json:"code"`
Message string `json:"message"`
}
func (a *AEvent) IsSuccess() bool {
return a.Code == "" && a.Message == "" && a.Text != ""
}