aws-lex-conversation 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +12 -5
- data/Gemfile +1 -1
- data/lib/aws/lex/conversation/base.rb +2 -0
- data/lib/aws/lex/conversation/response/base.rb +10 -4
- data/lib/aws/lex/conversation/response/close.rb +1 -1
- data/lib/aws/lex/conversation/response/confirm_intent.rb +1 -1
- data/lib/aws/lex/conversation/response/delegate.rb +1 -1
- data/lib/aws/lex/conversation/response/elicit_intent.rb +1 -1
- data/lib/aws/lex/conversation/response/elicit_slot.rb +1 -1
- data/lib/aws/lex/conversation/support/mixins/responses.rb +15 -10
- data/lib/aws/lex/conversation/type/context.rb +22 -0
- data/lib/aws/lex/conversation/type/event.rb +2 -0
- data/lib/aws/lex/conversation/type/intent.rb +1 -1
- data/lib/aws/lex/conversation/type/response.rb +1 -0
- data/lib/aws/lex/conversation/type/time_to_live.rb +26 -0
- data/lib/aws/lex/conversation/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50a4b4cc2a28aa4251723f715953de0a102e7cabb0268db095e50470e49e2772
|
4
|
+
data.tar.gz: a5bd7550ef4a7391c0d9221ac86b3c1760053b03dda9932d8416778f4ea319e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48883e2e7ce637dc0b6a327bdf839b9e233a3a1bc06f99b318f5bdbf83e91c762fb8c2bbe1ffc597ac8a6900d7a01ee4dfab7a67a52c2f941595754e13f8cb06
|
7
|
+
data.tar.gz: 3bf93255a75da95213ffc74a7a3a86785bba94ea70d758c53dbad1c351b3567f5bb6f23adffafbf67e7581ad9f4a9ece31a489ef35b9cd3ad31311121a209105
|
data/.rubocop.yml
CHANGED
@@ -5,35 +5,42 @@ AllCops:
|
|
5
5
|
Exclude:
|
6
6
|
- 'bin/**/*'
|
7
7
|
- 'vendor/**/*'
|
8
|
-
|
9
|
-
Enabled: false
|
8
|
+
SuggestExtensions: false
|
10
9
|
Gemspec/RequiredRubyVersion:
|
11
10
|
Enabled: false
|
12
11
|
Layout/FirstArrayElementIndentation:
|
13
12
|
Enabled: false
|
13
|
+
Layout/LineLength:
|
14
|
+
Max: 130
|
14
15
|
Layout/MultilineMethodCallIndentation:
|
15
16
|
Enabled: false
|
16
17
|
Layout/SpaceAroundOperators:
|
17
18
|
Enabled: false
|
18
19
|
Metrics/AbcSize:
|
19
|
-
Max:
|
20
|
+
Max: 20
|
20
21
|
Metrics/ClassLength:
|
21
22
|
Max: 150
|
22
23
|
Metrics/BlockLength:
|
23
24
|
Exclude:
|
24
25
|
- 'spec/**/*'
|
25
26
|
- '*.gemspec'
|
26
|
-
Metrics/LineLength:
|
27
|
-
Max: 130
|
28
27
|
Metrics/MethodLength:
|
29
28
|
Max: 25
|
30
29
|
Naming/FileName:
|
31
30
|
Enabled: true
|
32
31
|
Exclude:
|
33
32
|
- lib/aws-lex-conversation.rb
|
33
|
+
Style/Alias:
|
34
|
+
EnforcedStyle: prefer_alias_method
|
35
|
+
Style/Documentation:
|
36
|
+
Enabled: false
|
37
|
+
Style/DocumentDynamicEvalDefinition:
|
38
|
+
Enabled: false
|
34
39
|
Style/Lambda:
|
35
40
|
EnforcedStyle: literal
|
36
41
|
Style/GuardClause:
|
37
42
|
Enabled: false
|
43
|
+
Style/RedundantFetchBlock:
|
44
|
+
Enabled: false
|
38
45
|
Style/SlicingWithRange:
|
39
46
|
Enabled: false
|
data/Gemfile
CHANGED
@@ -26,10 +26,12 @@ require_relative 'type/dialog_action_type'
|
|
26
26
|
require_relative 'type/confirmation_status'
|
27
27
|
require_relative 'type/fulfillment_state'
|
28
28
|
require_relative 'type/intent_confidence'
|
29
|
+
require_relative 'type/time_to_live'
|
29
30
|
require_relative 'type/recent_intent_summary_view'
|
30
31
|
require_relative 'type/slot'
|
31
32
|
require_relative 'type/slot_resolution'
|
32
33
|
require_relative 'type/slot_detail'
|
34
|
+
require_relative 'type/context'
|
33
35
|
require_relative 'type/intent'
|
34
36
|
require_relative 'type/output_dialog_mode'
|
35
37
|
require_relative 'type/bot'
|
@@ -5,11 +5,16 @@ module Aws
|
|
5
5
|
class Conversation
|
6
6
|
module Response
|
7
7
|
class Base
|
8
|
-
attr_accessor
|
8
|
+
attr_accessor(
|
9
|
+
:active_contexts,
|
10
|
+
:recent_intent_summary_view,
|
11
|
+
:session_attributes
|
12
|
+
)
|
9
13
|
|
10
14
|
def initialize(opts = {})
|
11
|
-
self.
|
15
|
+
self.active_contexts = opts[:active_contexts]
|
12
16
|
self.recent_intent_summary_view = opts[:recent_intent_summary_view]
|
17
|
+
self.session_attributes = opts[:session_attributes]
|
13
18
|
end
|
14
19
|
|
15
20
|
def dialog_action
|
@@ -18,9 +23,10 @@ module Aws
|
|
18
23
|
|
19
24
|
def to_lex
|
20
25
|
Type::Response.new(
|
21
|
-
|
26
|
+
active_contexts: active_contexts,
|
27
|
+
dialog_action: dialog_action,
|
22
28
|
recent_intent_summary_view: recent_intent_summary_view,
|
23
|
-
|
29
|
+
session_attributes: session_attributes
|
24
30
|
).to_lex
|
25
31
|
end
|
26
32
|
end
|
@@ -8,17 +8,19 @@ module Aws
|
|
8
8
|
module Responses
|
9
9
|
def close(opts = {})
|
10
10
|
params = {
|
11
|
-
|
12
|
-
recent_intent_summary_view: lex.recent_intent_summary_view
|
11
|
+
active_contexts: lex.active_contexts,
|
12
|
+
recent_intent_summary_view: lex.recent_intent_summary_view,
|
13
|
+
session_attributes: lex.session_attributes
|
13
14
|
}.merge(opts)
|
14
15
|
Response::Close.new(params).to_lex
|
15
16
|
end
|
16
17
|
|
17
18
|
def confirm_intent(opts = {})
|
18
19
|
params = {
|
19
|
-
|
20
|
-
recent_intent_summary_view: lex.recent_intent_summary_view,
|
20
|
+
active_contexts: lex.active_contexts,
|
21
21
|
intent_name: lex.current_intent.name,
|
22
|
+
recent_intent_summary_view: lex.recent_intent_summary_view,
|
23
|
+
session_attributes: lex.session_attributes,
|
22
24
|
slots: lex.current_intent.slots
|
23
25
|
}.merge(opts)
|
24
26
|
Response::ConfirmIntent.new(params).to_lex
|
@@ -26,8 +28,9 @@ module Aws
|
|
26
28
|
|
27
29
|
def delegate(opts = {})
|
28
30
|
params = {
|
29
|
-
|
31
|
+
active_contexts: lex.active_contexts,
|
30
32
|
recent_intent_summary_view: lex.recent_intent_summary_view,
|
33
|
+
session_attributes: lex.session_attributes,
|
31
34
|
slots: lex.current_intent.slots
|
32
35
|
}.merge(opts)
|
33
36
|
Response::Delegate.new(params).to_lex
|
@@ -35,18 +38,20 @@ module Aws
|
|
35
38
|
|
36
39
|
def elicit_intent(opts = {})
|
37
40
|
params = {
|
38
|
-
|
39
|
-
recent_intent_summary_view: lex.recent_intent_summary_view
|
41
|
+
active_contexts: lex.active_contexts,
|
42
|
+
recent_intent_summary_view: lex.recent_intent_summary_view,
|
43
|
+
session_attributes: lex.session_attributes
|
40
44
|
}.merge(opts)
|
41
45
|
Response::ElicitIntent.new(params).to_lex
|
42
46
|
end
|
43
47
|
|
44
48
|
def elicit_slot(opts = {})
|
45
49
|
params = {
|
46
|
-
|
50
|
+
active_contexts: lex.active_contexts,
|
51
|
+
intent_name: lex.current_intent.name,
|
47
52
|
recent_intent_summary_view: lex.recent_intent_summary_view,
|
48
|
-
|
49
|
-
|
53
|
+
session_attributes: lex.session_attributes,
|
54
|
+
slots: lex.current_intent.slots
|
50
55
|
}.merge(opts)
|
51
56
|
Response::ElicitSlot.new(params).to_lex
|
52
57
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Aws
|
4
|
+
module Lex
|
5
|
+
class Conversation
|
6
|
+
module Type
|
7
|
+
class Context
|
8
|
+
include Base
|
9
|
+
|
10
|
+
required :time_to_live
|
11
|
+
required :name
|
12
|
+
required :parameters
|
13
|
+
|
14
|
+
coerce(
|
15
|
+
time_to_live: TimeToLive,
|
16
|
+
parameters: symbolize_hash!
|
17
|
+
)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -7,6 +7,7 @@ module Aws
|
|
7
7
|
class Event
|
8
8
|
include Base
|
9
9
|
|
10
|
+
required :active_contexts, default: -> { [] }
|
10
11
|
required :alternative_intents, default: -> { [] }
|
11
12
|
required :current_intent
|
12
13
|
required :bot
|
@@ -26,6 +27,7 @@ module Aws
|
|
26
27
|
end
|
27
28
|
|
28
29
|
coerce(
|
30
|
+
active_contexts: Array[Context],
|
29
31
|
alternative_intents: Array[Intent],
|
30
32
|
current_intent: Intent,
|
31
33
|
bot: Bot,
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Aws
|
4
|
+
module Lex
|
5
|
+
class Conversation
|
6
|
+
module Type
|
7
|
+
class TimeToLive
|
8
|
+
include Base
|
9
|
+
|
10
|
+
required :time_to_live_in_seconds
|
11
|
+
required :turns_to_live
|
12
|
+
|
13
|
+
coerce(
|
14
|
+
time_to_live_in_seconds: integer!,
|
15
|
+
turns_to_live: integer!
|
16
|
+
)
|
17
|
+
|
18
|
+
alias_method :seconds, :time_to_live_in_seconds
|
19
|
+
alias_method :seconds=, :time_to_live_in_seconds=
|
20
|
+
alias_method :turns, :turns_to_live
|
21
|
+
alias_method :turns=, :turns_to_live=
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
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: 2.
|
4
|
+
version: 2.1.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:
|
15
|
+
date: 2021-02-11 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: shrink_wrap
|
@@ -75,6 +75,7 @@ files:
|
|
75
75
|
- lib/aws/lex/conversation/type/base.rb
|
76
76
|
- lib/aws/lex/conversation/type/bot.rb
|
77
77
|
- lib/aws/lex/conversation/type/confirmation_status.rb
|
78
|
+
- lib/aws/lex/conversation/type/context.rb
|
78
79
|
- lib/aws/lex/conversation/type/dialog_action_type.rb
|
79
80
|
- lib/aws/lex/conversation/type/enumeration.rb
|
80
81
|
- lib/aws/lex/conversation/type/event.rb
|
@@ -97,6 +98,7 @@ files:
|
|
97
98
|
- lib/aws/lex/conversation/type/slot.rb
|
98
99
|
- lib/aws/lex/conversation/type/slot_detail.rb
|
99
100
|
- lib/aws/lex/conversation/type/slot_resolution.rb
|
101
|
+
- lib/aws/lex/conversation/type/time_to_live.rb
|
100
102
|
- lib/aws/lex/conversation/version.rb
|
101
103
|
homepage: https://github.com/amaabca/aws-lex-conversation
|
102
104
|
licenses:
|
@@ -118,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
120
|
- !ruby/object:Gem::Version
|
119
121
|
version: '0'
|
120
122
|
requirements: []
|
121
|
-
rubygems_version: 3.1.
|
123
|
+
rubygems_version: 3.1.4
|
122
124
|
signing_key:
|
123
125
|
specification_version: 4
|
124
126
|
summary: AWS Lex Conversation Dialog Management
|