Skip to content

Commit 3b0c5cc

Browse files
authored
Update Lex event to include confidence score and alternative intents (#360)
* Update Lex event to include confidence score and alternative intents * Fix Lex event to allow Alternative Intents array
1 parent b3dd246 commit 3b0c5cc

File tree

1 file changed

+24
-14
lines changed

1 file changed

+24
-14
lines changed

events/lex.go

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
package events
22

33
type LexEvent struct {
4-
MessageVersion string `json:"messageVersion,omitempty"`
5-
InvocationSource string `json:"invocationSource,omitempty"`
6-
UserID string `json:"userId,omitempty"`
7-
InputTranscript string `json:"inputTranscript,omitempty"`
8-
SessionAttributes SessionAttributes `json:"sessionAttributes,omitempty"`
9-
RequestAttributes map[string]string `json:"requestAttributes,omitempty"`
10-
Bot *LexBot `json:"bot,omitempty"`
11-
OutputDialogMode string `json:"outputDialogMode,omitempty"`
12-
CurrentIntent *LexCurrentIntent `json:"currentIntent,omitempty"`
13-
DialogAction *LexDialogAction `json:"dialogAction,omitempty"`
4+
MessageVersion string `json:"messageVersion,omitempty"`
5+
InvocationSource string `json:"invocationSource,omitempty"`
6+
UserID string `json:"userId,omitempty"`
7+
InputTranscript string `json:"inputTranscript,omitempty"`
8+
SessionAttributes SessionAttributes `json:"sessionAttributes,omitempty"`
9+
RequestAttributes map[string]string `json:"requestAttributes,omitempty"`
10+
Bot *LexBot `json:"bot,omitempty"`
11+
OutputDialogMode string `json:"outputDialogMode,omitempty"`
12+
CurrentIntent *LexCurrentIntent `json:"currentIntent,omitempty"`
13+
AlternativeIntents []LexAlternativeIntents `json:"alternativeIntents,omitempty"`
14+
DialogAction *LexDialogAction `json:"dialogAction,omitempty"`
1415
}
1516

1617
type LexBot struct {
@@ -20,10 +21,19 @@ type LexBot struct {
2021
}
2122

2223
type LexCurrentIntent struct {
23-
Name string `json:"name,omitempty"`
24-
Slots Slots `json:"slots,omitempty"`
25-
SlotDetails map[string]SlotDetail `json:"slotDetails,omitempty"`
26-
ConfirmationStatus string `json:"confirmationStatus,omitempty"`
24+
Name string `json:"name,omitempty"`
25+
NLUIntentConfidenceScore float64 `json:"nluIntentConfidenceScore,omitempty"`
26+
Slots Slots `json:"slots,omitempty"`
27+
SlotDetails map[string]SlotDetail `json:"slotDetails,omitempty"`
28+
ConfirmationStatus string `json:"confirmationStatus,omitempty"`
29+
}
30+
31+
type LexAlternativeIntents struct {
32+
Name string `json:"name,omitempty"`
33+
NLUIntentConfidenceScore float64 `json:"nluIntentConfidenceScore,omitempty"`
34+
Slots Slots `json:"slots,omitempty"`
35+
SlotDetails map[string]SlotDetail `json:"slotDetails,omitempty"`
36+
ConfirmationStatus string `json:"confirmationStatus,omitempty"`
2737
}
2838

2939
type SlotDetail struct {

0 commit comments

Comments
 (0)