aws-lex-conversation 4.0.0 → 4.0.1
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/CHANGELOG.md +38 -0
- data/lib/aws/lex/conversation/handler/echo.rb +6 -4
- data/lib/aws/lex/conversation/type/base.rb +5 -3
- data/lib/aws/lex/conversation/type/intent.rb +4 -4
- data/lib/aws/lex/conversation/type/session_attributes.rb +4 -6
- data/lib/aws/lex/conversation/type/session_state.rb +1 -1
- data/lib/aws/lex/conversation/type/slot_value.rb +8 -0
- 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: 476f05cfb93c1025db506486915dedc693c7ad4d89579841a6eb5400d96c29bd
|
4
|
+
data.tar.gz: db5be62a9dc9239d9fbdaaa93bef25ecd1fe7add316712d9c63e3cacd0b0b75b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d6b36def37b7daf757b05a769877ebc35186e0639c99847317457e8786d50d0def6e2b8d539bab73ad0d43c704d3325702f8331387bf5549361b70cf7ecf055
|
7
|
+
data.tar.gz: f6ac291760737662ea7452ad6ebc092f225aaefbccbcdc20f549c42b0aa1661267669b827bd82696a3d7d10c06c31e6deeaa4c9a2365cfc90739ab4dac3093f6
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,41 @@
|
|
1
|
+
# 4.0.1 - July 16, 2021
|
2
|
+
|
3
|
+
* Fix a bug with the `Aws::Lex::Conversation::Handler::Echo` class because it
|
4
|
+
didn't correctly return an array of messages required for Lex V2.
|
5
|
+
* Drop a call to `Hash#deep_symbolize_keys` so we don't implicitly rely on
|
6
|
+
ActiveSupport.
|
7
|
+
* Call `Hash#compact` when transforming a Lex response so we don't include any
|
8
|
+
`nil` values in the response.
|
9
|
+
|
10
|
+
# 4.0.0 - July 14, 2021
|
11
|
+
|
12
|
+
**breaking change** - Drop support for the Lex runtime version 1. If you are using Lex Version 1, please lock this gem to `~> 3.0.0`.
|
13
|
+
**breaking change** - Implement support and types for [Lex Version 2](https://docs.aws.amazon.com/lexv2/latest/dg/what-is.html), which implements a new Lambda [input/output event format](https://docs.aws.amazon.com/lexv2/latest/dg/lambda.html#lambda-input-format).
|
14
|
+
|
15
|
+
# 3.1.0 - June 1, 2021
|
16
|
+
|
17
|
+
* Default both `request_attributes` and `session_attributes`
|
18
|
+
to an empty Hash when the values from the event are `null`.
|
19
|
+
It is much easier to reason and write logic when you can
|
20
|
+
assume that these values are always at least a hash.
|
21
|
+
|
22
|
+
# 3.0.0 - May 20, 2021
|
23
|
+
|
24
|
+
* **breaking change** - Don't pass the `recentIntentSummaryView` back
|
25
|
+
in the Lex response unless we have modified or added an existing
|
26
|
+
checkpoint. Lex will persist the previous intent summary/history
|
27
|
+
if we do not send a `recentIntentSummaryView` value back in the
|
28
|
+
response (see [1]).
|
29
|
+
* Add a few helper methods to the `Aws::Lex::Conversation::Type::Slot`
|
30
|
+
instances:
|
31
|
+
|
32
|
+
- `active?`: returns true if the slot is defined (either optional or
|
33
|
+
required) for the current intent.
|
34
|
+
- `requestable?`: returns true if the slot is active for the current
|
35
|
+
intent and it is not filled.
|
36
|
+
|
37
|
+
[1]: https://docs.aws.amazon.com/lex/latest/dg/lambda-input-response-format.html#lambda-response-recentIntentSummaryView
|
38
|
+
|
1
39
|
# 2.0.0 - August 19, 2020
|
2
40
|
|
3
41
|
* **breaking change:** Rename `Aws::Lex::Conversation::Type::CurrentIntent` to `Aws::Lex::Conversation::Type::Intent`.
|
@@ -11,10 +11,12 @@ module Aws
|
|
11
11
|
fulfillment_state = options.fetch(:fulfillment_state) { Type::FulfillmentState.new('Fulfilled') }
|
12
12
|
conversation.close(
|
13
13
|
fulfillment_state: fulfillment_state,
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
messages: [
|
15
|
+
Type::Message.new(
|
16
|
+
content: content,
|
17
|
+
content_type: content_type
|
18
|
+
)
|
19
|
+
]
|
18
20
|
)
|
19
21
|
end
|
20
22
|
end
|
@@ -26,10 +26,11 @@ module Aws
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def to_lex
|
29
|
-
self.class.attributes.each_with_object({}) do |attribute, hash|
|
29
|
+
output = self.class.attributes.each_with_object({}) do |attribute, hash|
|
30
30
|
value = transform_to_lex(public_send(attribute))
|
31
31
|
hash[self.class.mapping.fetch(attribute)] = value
|
32
32
|
end
|
33
|
+
output.compact
|
33
34
|
end
|
34
35
|
|
35
36
|
private
|
@@ -40,9 +41,10 @@ module Aws
|
|
40
41
|
if value.respond_to?(:to_lex)
|
41
42
|
value.to_lex
|
42
43
|
else
|
43
|
-
value.each_with_object({}) do |(key, val), hash|
|
44
|
+
output = value.each_with_object({}) do |(key, val), hash|
|
44
45
|
hash[key.to_sym] = transform_to_lex(val)
|
45
46
|
end
|
47
|
+
output.compact
|
46
48
|
end
|
47
49
|
when Array
|
48
50
|
value.map { |v| transform_to_lex(v) }
|
@@ -66,7 +68,7 @@ module Aws
|
|
66
68
|
end
|
67
69
|
|
68
70
|
def symbolize_hash!
|
69
|
-
->(v) { v.
|
71
|
+
->(v) { v.transform_keys(&:to_sym) }
|
70
72
|
end
|
71
73
|
|
72
74
|
def computed_property(attribute, callable)
|
@@ -22,13 +22,13 @@ module Aws
|
|
22
22
|
end
|
23
23
|
|
24
24
|
instance.raw_slots.each_with_object(default_hash) do |(key, value), hash|
|
25
|
-
value
|
25
|
+
normalized = value&.transform_keys(&:to_sym) || { shape: 'Scalar' }
|
26
26
|
hash[key.to_sym] = Slot.shrink_wrap(
|
27
27
|
active: true,
|
28
28
|
name: key,
|
29
|
-
shape:
|
30
|
-
value:
|
31
|
-
values:
|
29
|
+
shape: normalized[:shape],
|
30
|
+
value: normalized[:value],
|
31
|
+
values: normalized[:values]
|
32
32
|
)
|
33
33
|
end
|
34
34
|
end
|
@@ -10,12 +10,10 @@ module Aws
|
|
10
10
|
optional :checkpoints
|
11
11
|
|
12
12
|
def checkpoints
|
13
|
-
@checkpoints ||=
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
Checkpoint.shrink_wrap(checkpoint)
|
18
|
-
end
|
13
|
+
@checkpoints ||= JSON.parse(
|
14
|
+
Base64.urlsafe_decode64(fetch(:checkpoints) { Base64.urlsafe_encode64([].to_json, padding: false) })
|
15
|
+
).map do |checkpoint|
|
16
|
+
Checkpoint.shrink_wrap(checkpoint)
|
19
17
|
end
|
20
18
|
end
|
21
19
|
|
@@ -16,7 +16,7 @@ module Aws
|
|
16
16
|
active_contexts: Array[Context],
|
17
17
|
dialog_action: DialogAction,
|
18
18
|
intent: Intent,
|
19
|
-
session_attributes: ->(v) { SessionAttributes[v.
|
19
|
+
session_attributes: ->(v) { SessionAttributes[v.transform_keys(&:to_sym)] }
|
20
20
|
)
|
21
21
|
end
|
22
22
|
end
|
@@ -14,6 +14,14 @@ module Aws
|
|
14
14
|
alias_method :value, :interpreted_value
|
15
15
|
alias_method :value=, :interpreted_value=
|
16
16
|
|
17
|
+
def to_lex
|
18
|
+
{
|
19
|
+
interpretedValue: interpreted_value,
|
20
|
+
originalValue: original_value,
|
21
|
+
resolvedValues: resolved_values
|
22
|
+
}
|
23
|
+
end
|
24
|
+
|
17
25
|
def resolve!(index: 0)
|
18
26
|
self.interpreted_value = resolved(index: index)
|
19
27
|
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.
|
4
|
+
version: 4.0.1
|
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-07-
|
15
|
+
date: 2021-07-16 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: shrink_wrap
|