RecastAI 3.1.0 → 3.1.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d475981de2a40b76f29ad3a39288de12feb3627
|
4
|
+
data.tar.gz: 359336db88d9408b7e3e2bab2af39f2ca2bc7884
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37dcd2110c7246f9d47547e7dcb9354c30d12960c5d48d781a757b51b891fc8d5003e116c62d01f7ce842a06997d10fedb15d8155e532e90ad0866c4e526d9a3
|
7
|
+
data.tar.gz: b878159e1de59ce925601989bfad40049c0239d84fbc894e96d6ece7106f8394d4417f4341a8d6089a2d6a29fc26095a1da09c78e1b4b72234c72067fe14ee37
|
@@ -7,7 +7,7 @@ module RecastAI
|
|
7
7
|
def initialize(request)
|
8
8
|
request = JSON.parse(request)
|
9
9
|
request.each do |k, v|
|
10
|
-
k = k.gsub(/(.)([A-Z])/,'\1_\2').downcase
|
10
|
+
k = k.gsub(/(.)([A-Z])/, '\1_\2').downcase
|
11
11
|
self.instance_variable_set("@#{k}", v)
|
12
12
|
self.define_singleton_method(k.to_sym){ v }
|
13
13
|
end
|
@@ -24,8 +24,8 @@ module RecastAI
|
|
24
24
|
@action = response['action'] ? Action.new(response['action']) : nil
|
25
25
|
@next_actions = response['next_actions'].map{ |i| Action.new(i) }
|
26
26
|
@sentiment = response['sentiment']
|
27
|
-
@memory = response['memory'].reject
|
28
|
-
@entities = response['entities'].flat_map{ |
|
27
|
+
@memory = response['memory'].reject{ |_, e| e.nil? }.map{ |n, e| Entity.new(n, e) }
|
28
|
+
@entities = response['entities'].flat_map{ |n, e| e.map{ |ee| Entity.new(n, ee) } }
|
29
29
|
@intents = response['intents'].map{ |i| Intent.new(i) }
|
30
30
|
@conversation_token = response['conversation_token']
|
31
31
|
@language = response['language']
|
@@ -92,7 +92,7 @@ module RecastAI
|
|
92
92
|
|
93
93
|
response = JSON.parse(response.body)
|
94
94
|
response = response['results']
|
95
|
-
response['memory'].reject
|
95
|
+
response['memory'].reject{ |_, e| e.nil? }.map{ |n, e| Entity.new(n, e) }
|
96
96
|
end
|
97
97
|
|
98
98
|
def reset_memory(name = nil)
|
@@ -108,7 +108,7 @@ module RecastAI
|
|
108
108
|
|
109
109
|
response = JSON.parse(response.body)
|
110
110
|
response = response['results']
|
111
|
-
response['memory'].reject
|
111
|
+
response['memory'].reject{ |_, e| e.nil? }.map{ |n, e| Entity.new(n, e) }
|
112
112
|
end
|
113
113
|
|
114
114
|
def reset_conversation
|
@@ -122,7 +122,7 @@ module RecastAI
|
|
122
122
|
|
123
123
|
response = JSON.parse(response.body)
|
124
124
|
response = response['results']
|
125
|
-
response['memory'].reject
|
125
|
+
response['memory'].reject{ |_, e| e.nil? }.map{ |n, e| Entity.new(n, e) }
|
126
126
|
end
|
127
127
|
end
|
128
128
|
end
|
data/lib/recastai/utils.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: RecastAI
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Renvoisé
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|