aws-lex-conversation 4.0.2 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8722262608a479a7c20069ac72e1e15c70e417fe92ffcbc4eaaab6b54defc792
|
4
|
+
data.tar.gz: ee77736e7e9c313a3de59b6c651253d226cfb5c0def75e52f50082489e514cd0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0c8edafbb942dd0e692908db397887c5fea54e2fef7be71369ed72be2debd62054cb4c31593f0d38598d895758c9bd5b0ce678f3e3ec05ec807354a230b51a6
|
7
|
+
data.tar.gz: 360558203dbc323968b841e8caf1f37cd3ee14afa43f308fa254d5edfee471321916527fd7806382614f19386f50c3753f8f7f403866d052c592dcdeccaf34e1
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,12 @@
|
|
1
|
-
# 4.0
|
1
|
+
# 4.3.0 - August 25, 2021
|
2
2
|
|
3
|
-
*
|
3
|
+
* Slot elicitor can now be passed an Aws::Lex::Conversation::Type::Message as part of the DSL/callback and properly formats the response as such
|
4
|
+
|
5
|
+
# 4.1.0 - July 21, 2021
|
6
|
+
|
7
|
+
* Don't set the `intent` property in the response for `ElicitIntent`
|
8
|
+
actions as the field is optional as per [AWS documentation](https://docs.aws.amazon.com/lexv2/latest/dg/lambda.html#lambda-response-format).
|
9
|
+
* Add `InProgress` and `ReadyForFulfillment` enumerations to `FulfillmentState`.
|
4
10
|
|
5
11
|
# 4.0.1 - July 16, 2021
|
6
12
|
|
@@ -5,38 +5,32 @@ module Aws
|
|
5
5
|
class Conversation
|
6
6
|
module Slot
|
7
7
|
class Elicitation
|
8
|
-
attr_accessor :name, :elicit, :
|
9
|
-
:
|
10
|
-
:conversation
|
8
|
+
attr_accessor :name, :elicit, :messages, :follow_up_messages,
|
9
|
+
:fallback, :maximum_elicitations, :conversation
|
11
10
|
|
12
11
|
def initialize(opts = {})
|
13
12
|
self.name = opts.fetch(:name)
|
14
13
|
self.elicit = opts.fetch(:elicit) { ->(_c) { true } }
|
15
|
-
self.
|
16
|
-
self.
|
17
|
-
self.
|
18
|
-
Aws::Lex::Conversation::Type::Message::ContentType.new('PlainText')
|
19
|
-
end
|
20
|
-
self.fallback = opts.fetch(:fallback) { ->(_c) {} }
|
14
|
+
self.messages = opts.fetch(:messages)
|
15
|
+
self.follow_up_messages = opts.fetch(:follow_up_messages) { opts.fetch(:messages) }
|
16
|
+
self.fallback = opts[:fallback]
|
21
17
|
self.maximum_elicitations = opts.fetch(:maximum_elicitations) { 0 }
|
22
18
|
end
|
23
19
|
|
24
20
|
def elicit!
|
21
|
+
return false unless elicit?
|
25
22
|
return fallback.call(conversation) if maximum_elicitations?
|
26
23
|
|
27
24
|
increment_slot_elicitations!
|
28
25
|
conversation.elicit_slot(
|
29
26
|
slot_to_elicit: name,
|
30
|
-
messages:
|
31
|
-
{
|
32
|
-
contentType: content_type,
|
33
|
-
content: elicitation_content
|
34
|
-
}
|
35
|
-
]
|
27
|
+
messages: elicitation_messages
|
36
28
|
)
|
37
29
|
end
|
38
30
|
|
39
31
|
def elicit?
|
32
|
+
return false if maximum_elicitations? && fallback.nil?
|
33
|
+
|
40
34
|
elicit.call(conversation) && !slot.filled?
|
41
35
|
end
|
42
36
|
|
@@ -46,11 +40,11 @@ module Aws
|
|
46
40
|
conversation.slots[name.to_sym]
|
47
41
|
end
|
48
42
|
|
49
|
-
def
|
50
|
-
first_elicitation? ?
|
43
|
+
def elicitation_messages
|
44
|
+
first_elicitation? ? compose_messages(messages) : compose_messages(follow_up_messages)
|
51
45
|
end
|
52
46
|
|
53
|
-
def
|
47
|
+
def compose_messages(msg)
|
54
48
|
msg.is_a?(Proc) ? msg.call(conversation) : msg
|
55
49
|
end
|
56
50
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-lex-conversation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jesse Doyle
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: exe
|
14
14
|
cert_chain: []
|
15
|
-
date: 2021-
|
15
|
+
date: 2021-08-30 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: shrink_wrap
|