aws-lex-conversation 0.5.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 +7 -0
- data/.github/workflows/ci.yml +35 -0
- data/.gitignore +15 -0
- data/.rspec +3 -0
- data/.rubocop.yml +29 -0
- data/.simplecov +5 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +12 -0
- data/LICENSE.md +21 -0
- data/README.md +160 -0
- data/Rakefile +11 -0
- data/aws-lex-conversation.gemspec +38 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/lib/aws-lex-conversation.rb +3 -0
- data/lib/aws/lex/conversation.rb +58 -0
- data/lib/aws/lex/conversation/base.rb +40 -0
- data/lib/aws/lex/conversation/handler/base.rb +34 -0
- data/lib/aws/lex/conversation/handler/delegate.rb +17 -0
- data/lib/aws/lex/conversation/handler/echo.rb +24 -0
- data/lib/aws/lex/conversation/response/base.rb +30 -0
- data/lib/aws/lex/conversation/response/close.rb +29 -0
- data/lib/aws/lex/conversation/response/confirm_intent.rb +31 -0
- data/lib/aws/lex/conversation/response/delegate.rb +29 -0
- data/lib/aws/lex/conversation/response/elicit_intent.rb +27 -0
- data/lib/aws/lex/conversation/response/elicit_slot.rb +33 -0
- data/lib/aws/lex/conversation/support/inflector.rb +43 -0
- data/lib/aws/lex/conversation/support/responses.rb +56 -0
- data/lib/aws/lex/conversation/type/base.rb +95 -0
- data/lib/aws/lex/conversation/type/bot.rb +17 -0
- data/lib/aws/lex/conversation/type/confirmation_status.rb +17 -0
- data/lib/aws/lex/conversation/type/current_intent.rb +34 -0
- data/lib/aws/lex/conversation/type/dialog_action_type.rb +19 -0
- data/lib/aws/lex/conversation/type/enumeration.rb +44 -0
- data/lib/aws/lex/conversation/type/event.rb +37 -0
- data/lib/aws/lex/conversation/type/fulfillment_state.rb +16 -0
- data/lib/aws/lex/conversation/type/invocation_source.rb +16 -0
- data/lib/aws/lex/conversation/type/message.rb +20 -0
- data/lib/aws/lex/conversation/type/message/content_type.rb +19 -0
- data/lib/aws/lex/conversation/type/output_dialog_mode.rb +16 -0
- data/lib/aws/lex/conversation/type/recent_intent_summary_view.rb +29 -0
- data/lib/aws/lex/conversation/type/response.rb +17 -0
- data/lib/aws/lex/conversation/type/response_card.rb +23 -0
- data/lib/aws/lex/conversation/type/response_card/button.rb +18 -0
- data/lib/aws/lex/conversation/type/response_card/content_type.rb +17 -0
- data/lib/aws/lex/conversation/type/response_card/generic_attachment.rb +26 -0
- data/lib/aws/lex/conversation/type/sentiment_label.rb +18 -0
- data/lib/aws/lex/conversation/type/sentiment_response.rb +21 -0
- data/lib/aws/lex/conversation/type/sentiment_score.rb +35 -0
- data/lib/aws/lex/conversation/type/slot_detail.rb +20 -0
- data/lib/aws/lex/conversation/type/slot_resolution.rb +15 -0
- data/lib/aws/lex/conversation/version.rb +9 -0
- metadata +117 -0
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Aws
|
4
|
+
module Lex
|
5
|
+
class Conversation
|
6
|
+
module Type
|
7
|
+
class ResponseCard
|
8
|
+
class ContentType
|
9
|
+
include Enumeration
|
10
|
+
|
11
|
+
enumeration('application/vnd.amazonaws.card.generic')
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Aws
|
4
|
+
module Lex
|
5
|
+
class Conversation
|
6
|
+
module Type
|
7
|
+
class ResponseCard
|
8
|
+
class GenericAttachment
|
9
|
+
include Base
|
10
|
+
|
11
|
+
required :title
|
12
|
+
required :buttons
|
13
|
+
|
14
|
+
optional :sub_title
|
15
|
+
optional :image_url
|
16
|
+
optional :attachment_link_url
|
17
|
+
|
18
|
+
coerce(
|
19
|
+
buttons: Array[Button]
|
20
|
+
)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Aws
|
4
|
+
module Lex
|
5
|
+
class Conversation
|
6
|
+
module Type
|
7
|
+
class SentimentLabel
|
8
|
+
include Enumeration
|
9
|
+
|
10
|
+
enumeration('POSITIVE')
|
11
|
+
enumeration('MIXED')
|
12
|
+
enumeration('NEUTRAL')
|
13
|
+
enumeration('NEGATIVE')
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Aws
|
4
|
+
module Lex
|
5
|
+
class Conversation
|
6
|
+
module Type
|
7
|
+
class SentimentResponse
|
8
|
+
include Base
|
9
|
+
|
10
|
+
required :sentiment_label
|
11
|
+
required :sentiment_score
|
12
|
+
|
13
|
+
coerce(
|
14
|
+
sentiment_label: SentimentLabel,
|
15
|
+
sentiment_score: ->(v) { SentimentScore.parse_string(v) }
|
16
|
+
)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Aws
|
4
|
+
module Lex
|
5
|
+
class Conversation
|
6
|
+
module Type
|
7
|
+
class SentimentScore
|
8
|
+
include Base
|
9
|
+
|
10
|
+
required :positive, from: :Positive
|
11
|
+
required :negative, from: :Negative
|
12
|
+
required :neutral, from: :Neutral
|
13
|
+
required :mixed, from: :Mixed
|
14
|
+
|
15
|
+
class << self
|
16
|
+
def parse_string(str)
|
17
|
+
parts = str
|
18
|
+
.gsub(/[{}]/, '') # remove '{' or '}' chars
|
19
|
+
.split(',') # break into components
|
20
|
+
.map { |c| c.gsub(/\s/, '').split(':') }
|
21
|
+
|
22
|
+
params = parts.each_with_object({}) do |part, hash|
|
23
|
+
label = part.first
|
24
|
+
value = part.last.to_f
|
25
|
+
hash[label] = value
|
26
|
+
end
|
27
|
+
|
28
|
+
shrink_wrap(params)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Aws
|
4
|
+
module Lex
|
5
|
+
class Conversation
|
6
|
+
module Type
|
7
|
+
class SlotDetail
|
8
|
+
include Base
|
9
|
+
|
10
|
+
required :resolutions
|
11
|
+
required :original_value
|
12
|
+
|
13
|
+
coerce(
|
14
|
+
resolutions: Array[SlotResolution]
|
15
|
+
)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
metadata
ADDED
@@ -0,0 +1,117 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: aws-lex-conversation
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.5.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jesse Doyle
|
8
|
+
- Michael van den Beuken
|
9
|
+
- Darko Dosenovic
|
10
|
+
- Zoie Carnegie
|
11
|
+
- Carlos Mejia Castelo
|
12
|
+
autorequire:
|
13
|
+
bindir: exe
|
14
|
+
cert_chain: []
|
15
|
+
date: 2020-06-23 00:00:00.000000000 Z
|
16
|
+
dependencies:
|
17
|
+
- !ruby/object:Gem::Dependency
|
18
|
+
name: shrink_wrap
|
19
|
+
requirement: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: '0'
|
24
|
+
type: :runtime
|
25
|
+
prerelease: false
|
26
|
+
version_requirements: !ruby/object:Gem::Requirement
|
27
|
+
requirements:
|
28
|
+
- - ">="
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: '0'
|
31
|
+
description: Easily manage the flow and logic of your AWS Lex conversations.
|
32
|
+
email:
|
33
|
+
- jesse.doyle@ama.ab.ca
|
34
|
+
- michael.vandenbeuken@ama.ab.ca
|
35
|
+
- darko.dosenovic@ama.ab.ca
|
36
|
+
- zoie.carnegie@ama.ab.ca
|
37
|
+
- carlos.mejiacastelo@ama.ab.ca
|
38
|
+
executables: []
|
39
|
+
extensions: []
|
40
|
+
extra_rdoc_files: []
|
41
|
+
files:
|
42
|
+
- ".github/workflows/ci.yml"
|
43
|
+
- ".gitignore"
|
44
|
+
- ".rspec"
|
45
|
+
- ".rubocop.yml"
|
46
|
+
- ".simplecov"
|
47
|
+
- CODE_OF_CONDUCT.md
|
48
|
+
- Gemfile
|
49
|
+
- LICENSE.md
|
50
|
+
- README.md
|
51
|
+
- Rakefile
|
52
|
+
- aws-lex-conversation.gemspec
|
53
|
+
- bin/console
|
54
|
+
- bin/setup
|
55
|
+
- lib/aws-lex-conversation.rb
|
56
|
+
- lib/aws/lex/conversation.rb
|
57
|
+
- lib/aws/lex/conversation/base.rb
|
58
|
+
- lib/aws/lex/conversation/handler/base.rb
|
59
|
+
- lib/aws/lex/conversation/handler/delegate.rb
|
60
|
+
- lib/aws/lex/conversation/handler/echo.rb
|
61
|
+
- lib/aws/lex/conversation/response/base.rb
|
62
|
+
- lib/aws/lex/conversation/response/close.rb
|
63
|
+
- lib/aws/lex/conversation/response/confirm_intent.rb
|
64
|
+
- lib/aws/lex/conversation/response/delegate.rb
|
65
|
+
- lib/aws/lex/conversation/response/elicit_intent.rb
|
66
|
+
- lib/aws/lex/conversation/response/elicit_slot.rb
|
67
|
+
- lib/aws/lex/conversation/support/inflector.rb
|
68
|
+
- lib/aws/lex/conversation/support/responses.rb
|
69
|
+
- lib/aws/lex/conversation/type/base.rb
|
70
|
+
- lib/aws/lex/conversation/type/bot.rb
|
71
|
+
- lib/aws/lex/conversation/type/confirmation_status.rb
|
72
|
+
- lib/aws/lex/conversation/type/current_intent.rb
|
73
|
+
- lib/aws/lex/conversation/type/dialog_action_type.rb
|
74
|
+
- lib/aws/lex/conversation/type/enumeration.rb
|
75
|
+
- lib/aws/lex/conversation/type/event.rb
|
76
|
+
- lib/aws/lex/conversation/type/fulfillment_state.rb
|
77
|
+
- lib/aws/lex/conversation/type/invocation_source.rb
|
78
|
+
- lib/aws/lex/conversation/type/message.rb
|
79
|
+
- lib/aws/lex/conversation/type/message/content_type.rb
|
80
|
+
- lib/aws/lex/conversation/type/output_dialog_mode.rb
|
81
|
+
- lib/aws/lex/conversation/type/recent_intent_summary_view.rb
|
82
|
+
- lib/aws/lex/conversation/type/response.rb
|
83
|
+
- lib/aws/lex/conversation/type/response_card.rb
|
84
|
+
- lib/aws/lex/conversation/type/response_card/button.rb
|
85
|
+
- lib/aws/lex/conversation/type/response_card/content_type.rb
|
86
|
+
- lib/aws/lex/conversation/type/response_card/generic_attachment.rb
|
87
|
+
- lib/aws/lex/conversation/type/sentiment_label.rb
|
88
|
+
- lib/aws/lex/conversation/type/sentiment_response.rb
|
89
|
+
- lib/aws/lex/conversation/type/sentiment_score.rb
|
90
|
+
- lib/aws/lex/conversation/type/slot_detail.rb
|
91
|
+
- lib/aws/lex/conversation/type/slot_resolution.rb
|
92
|
+
- lib/aws/lex/conversation/version.rb
|
93
|
+
homepage: https://github.com/amaabca/aws-lex-conversation
|
94
|
+
licenses:
|
95
|
+
- MIT
|
96
|
+
metadata:
|
97
|
+
homepage_uri: https://github.com/amaabca/aws-lex-conversation
|
98
|
+
post_install_message:
|
99
|
+
rdoc_options: []
|
100
|
+
require_paths:
|
101
|
+
- lib
|
102
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
103
|
+
requirements:
|
104
|
+
- - ">="
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: 2.3.0
|
107
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0'
|
112
|
+
requirements: []
|
113
|
+
rubygems_version: 3.1.2
|
114
|
+
signing_key:
|
115
|
+
specification_version: 4
|
116
|
+
summary: AWS Lex Conversation Dialog Management
|
117
|
+
test_files: []
|