aws-lex-conversation 4.0.1 → 4.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 476f05cfb93c1025db506486915dedc693c7ad4d89579841a6eb5400d96c29bd
4
- data.tar.gz: db5be62a9dc9239d9fbdaaa93bef25ecd1fe7add316712d9c63e3cacd0b0b75b
3
+ metadata.gz: 69743533fc27787f0b8ac0f5d2a002496a118c92949c57b90ab1738439a7618d
4
+ data.tar.gz: 98d688962a53a164c398436a9f9101cfedd50dc0238598a3c71e387e6f271f89
5
5
  SHA512:
6
- metadata.gz: 7d6b36def37b7daf757b05a769877ebc35186e0639c99847317457e8786d50d0def6e2b8d539bab73ad0d43c704d3325702f8331387bf5549361b70cf7ecf055
7
- data.tar.gz: f6ac291760737662ea7452ad6ebc092f225aaefbccbcdc20f549c42b0aa1661267669b827bd82696a3d7d10c06c31e6deeaa4c9a2365cfc90739ab4dac3093f6
6
+ metadata.gz: 336228d5bebb36f2f275a78decf3459ce34c48bdaf4c73d48b2f3c15634d414fbf4f3036bb1603b0996b8026cb49605b11d20ef1d5f0b30bc993638aaa549eb2
7
+ data.tar.gz: 7d7147e2c8c65dfa93424f5bb366206b825d9c88c2831f3a140294002ebd6805da384ead59538e964c2934b33a11fb9c80b22c915ece0007382532ef0bb87691
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ # 4.3.0 - August 25, 2021
2
+
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`.
10
+
1
11
  # 4.0.1 - July 16, 2021
2
12
 
3
13
  * Fix a bug with the `Aws::Lex::Conversation::Handler::Echo` class because it
@@ -10,6 +10,8 @@ module Aws
10
10
  def initialize(opts = {})
11
11
  super
12
12
  session_state.dialog_action = dialog_action
13
+ # by default, we set intent as nil unless overridden
14
+ session_state.intent = opts[:intent]
13
15
  end
14
16
 
15
17
  def dialog_action
@@ -28,14 +28,15 @@ module Aws
28
28
  conversation.elicit_slot(
29
29
  slot_to_elicit: name,
30
30
  messages: [
31
- {
32
- contentType: content_type,
33
- content: elicitation_content
34
- }
31
+ elicitation_message
35
32
  ]
36
33
  )
37
34
  end
38
35
 
36
+ def message_content_type
37
+ content_type.is_a?(Proc) ? content_type.call(conversation) : content_type
38
+ end
39
+
39
40
  def elicit?
40
41
  elicit.call(conversation) && !slot.filled?
41
42
  end
@@ -46,12 +47,21 @@ module Aws
46
47
  conversation.slots[name.to_sym]
47
48
  end
48
49
 
49
- def elicitation_content
50
+ def elicitation_message
50
51
  first_elicitation? ? compose_message(message) : compose_message(follow_up_message)
51
52
  end
52
53
 
53
54
  def compose_message(msg)
54
- msg.is_a?(Proc) ? msg.call(conversation) : msg
55
+ content = msg.is_a?(Proc) ? msg.call(conversation) : msg
56
+
57
+ if content.is_a?(Aws::Lex::Conversation::Type::Message)
58
+ content
59
+ else
60
+ {
61
+ content: content,
62
+ contentType: message_content_type
63
+ }
64
+ end
55
65
  end
56
66
 
57
67
  def increment_slot_elicitations!
@@ -9,7 +9,7 @@ module Aws
9
9
 
10
10
  required :bot
11
11
  required :input_mode
12
- required :input_transcript
12
+ required :input_transcript, default: -> { '' }
13
13
  required :interpretations
14
14
  required :invocation_source
15
15
  required :message_version
@@ -9,6 +9,8 @@ module Aws
9
9
 
10
10
  enumeration('Fulfilled')
11
11
  enumeration('Failed')
12
+ enumeration('InProgress')
13
+ enumeration('ReadyForFulfillment')
12
14
  end
13
15
  end
14
16
  end
@@ -3,7 +3,7 @@
3
3
  module Aws
4
4
  module Lex
5
5
  class Conversation
6
- VERSION = '4.0.1'
6
+ VERSION = '4.3.0'
7
7
  end
8
8
  end
9
9
  end
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.0.1
4
+ version: 4.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jesse Doyle
@@ -9,10 +9,10 @@ authors:
9
9
  - Darko Dosenovic
10
10
  - Zoie Carnegie
11
11
  - Carlos Mejia Castelo
12
- autorequire:
12
+ autorequire:
13
13
  bindir: exe
14
14
  cert_chain: []
15
- date: 2021-07-16 00:00:00.000000000 Z
15
+ date: 2021-08-26 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: shrink_wrap
@@ -107,7 +107,7 @@ licenses:
107
107
  - MIT
108
108
  metadata:
109
109
  homepage_uri: https://github.com/amaabca/aws-lex-conversation
110
- post_install_message:
110
+ post_install_message:
111
111
  rdoc_options: []
112
112
  require_paths:
113
113
  - lib
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
123
  version: '0'
124
124
  requirements: []
125
125
  rubygems_version: 3.1.2
126
- signing_key:
126
+ signing_key:
127
127
  specification_version: 4
128
128
  summary: AWS Lex Conversation Dialog Management
129
129
  test_files: []