aws-lex-conversation 1.1.2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/aws/lex/conversation/slot/elicitation.rb +5 -1
- data/lib/aws/lex/conversation/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb6d1313f30041f9896bccc30fe2511d7eb0f377f505dc3c3c8e153e2838151d
|
4
|
+
data.tar.gz: aa0804ca414e0c68d982ae8ba601a7f46a729678130babb56d7eb87edf119cd3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3471ce6eddb122e71cb81aad093e663165bae469b8317c045eddb4f3ba21412ed3815e3f9e895aea121a6af61ae143abb15c0cff1520c10243bfe51a807b09b8
|
7
|
+
data.tar.gz: 906124b34ad1218de0c2725942620fc530120b855cf8e12552c8fc9b841fa18894a7327d92e908ff02e8e3bf276da7d1c4a951efcb87bb2c8f4dd19ecf057bc0
|
data/README.md
CHANGED
@@ -58,13 +58,13 @@ The first handler that returns `true` for the `will_respond?` method will provid
|
|
58
58
|
```ruby
|
59
59
|
class SayHello < Aws::Lex::Conversation::Handler::Base
|
60
60
|
def will_respond?(conversation)
|
61
|
-
conversation.lex.
|
61
|
+
conversation.lex.invocation_source.dialog_code_hook? && # callback is for DialogCodeHook (i.e. validation)
|
62
62
|
conversation.lex.current_intent.name == 'SayHello' && # Lex has routed to the 'SayHello' intent
|
63
|
-
conversation.slots[:name]
|
63
|
+
conversation.slots[:name].filled? # our expected slot value is set
|
64
64
|
end
|
65
65
|
|
66
66
|
def response(conversation)
|
67
|
-
name = conversation.slots[:name]
|
67
|
+
name = conversation.slots[:name].value
|
68
68
|
|
69
69
|
# NOTE: you can use the Type::* classes if you wish. The final output
|
70
70
|
# will be normalized to a value that complies with the Lex response format.
|
@@ -45,7 +45,11 @@ module Aws
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def elicitation_content
|
48
|
-
first_elicitation? ? message : follow_up_message
|
48
|
+
first_elicitation? ? compose_message(message) : compose_message(follow_up_message)
|
49
|
+
end
|
50
|
+
|
51
|
+
def compose_message(msg)
|
52
|
+
msg.is_a?(Proc) ? msg.call(conversation) : msg
|
49
53
|
end
|
50
54
|
|
51
55
|
def increment_slot_elicitations!
|
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: 1.
|
4
|
+
version: 1.2.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: 2020-
|
15
|
+
date: 2020-07-22 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: shrink_wrap
|