wit_bot 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -55
- data/bin/wit +4 -1
- data/examples/helpers/helpers.rb +4 -1
- data/examples/simple.rb +3 -0
- data/lib/wit_bot/models/wit/entity/entity_model.rb +4 -0
- data/lib/wit_bot/version.rb +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: 1e387a08441a8c5f9c9b1fa391cd8ac4b5a1edb9
|
4
|
+
data.tar.gz: 6d49997d4fff960c07f92ed6200cbb72814d1dc9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa5a966a259be1ad435f06600a0b15a17b18749047625ce923192e3cceebbbb32607323df8091f20e5e069859eb79870dff82c29dfe824628bc62905600bb6a7
|
7
|
+
data.tar.gz: 7d5ae281e07a6382491a7a830f9001197712576dc21152f859d57bc6b0828e6efdfbd7d713c1e16bfa4575a77bd9d053ad503e3a572960b7383f3da6b10e0717
|
data/README.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# WitBot
|
2
2
|
|
3
|
+
![gem version](https://img.shields.io/gem/v/wit_bot.svg?style=flat-square)
|
4
|
+
![gem rank](https://img.shields.io/gem/rt/wit_bot.svg?style=flat-square)
|
5
|
+
![gem downloads](https://img.shields.io/gem/dt/wit_bot.svg?style=flat-square)
|
6
|
+
|
3
7
|
A better [wit.ai] client for Ruby. Written in Ruby. With an api for creating bots.
|
4
8
|
|
5
9
|
Pretty Awesome™
|
@@ -22,64 +26,11 @@ Or install it yourself as:
|
|
22
26
|
|
23
27
|
## Usage
|
24
28
|
|
25
|
-
|
26
|
-
|
27
|
-
```bash
|
28
|
-
$ wit
|
29
|
-
```
|
30
|
-
|
31
|
-
or use with STDIO
|
32
|
-
|
33
|
-
```bash
|
34
|
-
$ wit --input --json
|
35
|
-
```
|
36
|
-
|
37
|
-
or use programmatically
|
38
|
-
|
39
|
-
1. Configure WitBot with your access token:
|
40
|
-
|
41
|
-
```ruby
|
42
|
-
WitBot.configure do |c|
|
43
|
-
c.token = ENV['WIT_AI_TOKEN']
|
44
|
-
end
|
45
|
-
```
|
46
|
-
|
47
|
-
2. Create a message:
|
48
|
-
|
49
|
-
```ruby
|
50
|
-
message = WitBot.create_message 'This is a cool test'
|
51
|
-
```
|
52
|
-
|
53
|
-
3. And send it:
|
54
|
-
|
55
|
-
```ruby
|
56
|
-
message.send
|
57
|
-
```
|
58
|
-
|
59
|
-
4. Get the outcome:
|
60
|
-
|
61
|
-
```ruby
|
62
|
-
outcome = message.outcome
|
63
|
-
```
|
64
|
-
|
65
|
-
5. Get the intent and the entities:
|
66
|
-
|
67
|
-
```ruby
|
68
|
-
intent = outcome.intent #=> WitBot::WitModel::Intent
|
69
|
-
entities = outcome.entities #=> {role => #<WitBot::WitModel::Entity>}
|
70
|
-
```
|
71
|
-
|
72
|
-
6. Get the intent name:
|
73
|
-
|
74
|
-
```ruby
|
75
|
-
intent.name #=> "Test"
|
76
|
-
```
|
77
|
-
|
78
|
-
More information on the [GitHub wiki][wiki].
|
29
|
+
Usage information is on the [wiki].
|
79
30
|
|
80
31
|
## Development
|
81
32
|
|
82
|
-
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
33
|
+
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` or `bin/wit` for an interactive prompt that will allow you to experiment.
|
83
34
|
|
84
35
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
85
36
|
|
data/bin/wit
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
+
lib = File.expand_path('../../lib', __FILE__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
|
3
6
|
require 'awesome_print'
|
4
7
|
require 'optparse'
|
5
8
|
require 'json'
|
@@ -49,7 +52,7 @@ message = nil
|
|
49
52
|
|
50
53
|
if repl
|
51
54
|
begin
|
52
|
-
puts
|
55
|
+
puts "Starting Wit REPL v#{WitBot::VERSION}:"
|
53
56
|
loop do
|
54
57
|
print 'wit > '
|
55
58
|
|
data/examples/helpers/helpers.rb
CHANGED
data/examples/simple.rb
CHANGED
data/lib/wit_bot/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wit_bot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben (@penne12_)
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|