wit 3.3.0 → 3.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +5 -0
- data/README.md +3 -3
- data/lib/wit.rb +3 -1
- data/wit.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd594fc892e82bfd4d1a23bff6eb062a3b31a117
|
4
|
+
data.tar.gz: a385c71e0165ab8ca866effc5e099fbe48547834
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 059661c6167529bc21f5700f7a93db866629cd20bb103b479b625f31982e84a3d97995990eaa27e6ebaf1596aced8df7c85cc5b4126f1a23da1e8446c55eca6d
|
7
|
+
data.tar.gz: e934ef82f3b4178b5fe36d681708e0a40a7df88695b5441b6df777abe103c0d9d51f06b5d4459fc9505372667c00c97f0a101dd43dcf7fc77cbe9d905727f91c
|
data/CHANGES.md
CHANGED
data/README.md
CHANGED
@@ -42,14 +42,14 @@ You need to provide at least an implementation for the special actions `:say`, `
|
|
42
42
|
A minimal `actions` `Hash` looks like this:
|
43
43
|
```ruby
|
44
44
|
actions = {
|
45
|
-
:say => -> (session_id, msg) {
|
45
|
+
:say => -> (session_id, context, msg) {
|
46
46
|
p msg
|
47
47
|
},
|
48
48
|
:merge => -> (session_id, context, entities, msg) {
|
49
49
|
return context
|
50
50
|
},
|
51
|
-
:error => -> (session_id, context) {
|
52
|
-
p
|
51
|
+
:error => -> (session_id, context, error) {
|
52
|
+
p error.message
|
53
53
|
},
|
54
54
|
}
|
55
55
|
```
|
data/lib/wit.rb
CHANGED
@@ -72,6 +72,7 @@ class Wit
|
|
72
72
|
end
|
73
73
|
|
74
74
|
def converse(session_id, msg, context={})
|
75
|
+
raise WitException.new 'context should be a Hash' unless context.is_a? Hash
|
75
76
|
params = {}
|
76
77
|
params[:q] = msg unless msg.nil?
|
77
78
|
params[:session_id] = session_id
|
@@ -116,10 +117,11 @@ class Wit
|
|
116
117
|
else
|
117
118
|
raise WitException.new "unknown type: #{type}"
|
118
119
|
end
|
119
|
-
return
|
120
|
+
return run_actions_ session_id, nil, context, max_steps - 1, user_message
|
120
121
|
end
|
121
122
|
|
122
123
|
def run_actions(session_id, message, context={}, max_steps=DEFAULT_MAX_STEPS)
|
124
|
+
raise WitException.new 'context should be a Hash' unless context.is_a? Hash
|
123
125
|
return run_actions_ session_id, message, context, max_steps, message
|
124
126
|
end
|
125
127
|
|
data/wit.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.3.
|
4
|
+
version: 3.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Wit Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Ruby SDK for Wit.ai
|
14
14
|
email: help@wit.ai
|