witai-charyf 0.2.0 → 0.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3bdb9e479da32a198798e5f5f75a37051f3b6373
4
- data.tar.gz: cfaec1ce78a70a836d4d2df6a319c54d152c7b6a
3
+ metadata.gz: 21b73b62decb583d09e7ec92651ec8bb79bf2073
4
+ data.tar.gz: 98137080809ae25d5874afefb8823640da226aaa
5
5
  SHA512:
6
- metadata.gz: 9359a1eaae707dd76b64112bec3dbe03c6530100c94198966a35048ea76d49027ce08c9cbc199819e3e1d4f723575c4218ed93a8728a90615670942cab7a2316
7
- data.tar.gz: eabd2d18f413e457e9c92f60e706d11d3bda511970b6ab9ee7ff01ab161b7373e9a9c0df786ec761bc811410959f3dd8955b04991f09627866fe7935d6c32e4b
6
+ metadata.gz: 63114f7199fb2432f0ec885060069b589cacd14f552dab3d1b0c602881677b2c772ffb2900e7bc556c40991c941566c162600d7548315537ab4c192ecae04d5c
7
+ data.tar.gz: 3b03e7e82f1136abd3fdceb70d88eb1e4b7b8efe1ad8979627d1b235f9e62355bf6ae8248c17c03749a6232c2a62c63ab07ddde4c5bbdd7d02f6c0d7147534e0
data/.gitignore CHANGED
@@ -10,4 +10,5 @@
10
10
 
11
11
  # rspec failure tracking
12
12
  .rspec_status
13
- .idea
13
+ .idea
14
+ .rvmrc
data/README.md CHANGED
@@ -6,33 +6,48 @@ TODO: Delete this and the text above, and describe your gem
6
6
 
7
7
  ## Installation
8
8
 
9
- Add this line to your application's Gemfile:
9
+ ### New application
10
+ When generating new charyf app, you can install wit intent processor automatically by specifying
11
+ ``charyf new [app_nane] --intent-processors=wit``
10
12
 
13
+ ### Existing application
14
+
15
+ To install wit processor to existing charyf application
16
+ Add gem to your gemfile
11
17
  ```ruby
12
- gem 'wit-nlp-charyf'
18
+ gem 'adapt-charyf', '>= 0.2.4'
13
19
  ```
14
20
 
15
- And then execute:
16
-
17
- $ bundle
18
-
19
- Or install it yourself as:
21
+ Edit *enabled_intent_processors* inside *config/application.rb*
22
+ ```ruby
23
+ config.enabled_intent_processors = [:wit, etc...]
24
+ ```
20
25
 
21
- $ gem install wit-nlp-charyf
26
+ Add the require inside inside *config/load.rb*
27
+ ```ruby
28
+ require 'witai/charyf'
29
+ ```
22
30
 
23
- ## Usage
31
+ ### Configure
24
32
 
25
- TODO: Write usage instructions here
33
+ If you dont set your api keys for wit application, the initialization will throw
34
+ ``/Users/rycco/.rvm/gems/ruby-2.2.2@charyf/gems/witai-charyf-0.2.0/lib/witai/charyf/processor.rb:18:in `initialize': WitAI::Charyf.api_key has not been set (WitAI::Charyf::Processor::NoKeyProvided)``
26
35
 
27
- ## Development
36
+ To configure create file *config/initializers/witai.rb* and set the API key
37
+ ```ruby
38
+ require 'witai/charyf'
28
39
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
40
+ WitAI::Charyf::Extension.configure do
41
+ config.api_key = 'SOME_CLIENT_API_KEY'
42
+ end
43
+ ```
30
44
 
31
- 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).
45
+ ## Usage
32
46
 
33
- ## Contributing
47
+ To define intent visit http://wit.ai/ and define an intent and entities inside your application.
48
+ Don't forget to wait for training to finish.
34
49
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/wit-nlp-charyf. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
50
+ Define routing as usually using *config/routes.rb*
36
51
 
37
52
  ## License
38
53
 
data/lib/witai/charyf.rb CHANGED
@@ -7,6 +7,10 @@ module WitAI
7
7
  module Charyf
8
8
  class Extension < ::Charyf::Extension
9
9
 
10
+ generators do
11
+ require_relative 'charyf/generators/install/install_generator'
12
+ end
13
+
10
14
  config.api_key = nil
11
15
 
12
16
  end
@@ -0,0 +1,27 @@
1
+ require 'charyf/utils/generator/base'
2
+
3
+ module WitAI
4
+ module Charyf
5
+ module Generators
6
+ class InstallGenerator < ::Charyf::Generators::Base
7
+
8
+ source_root File.expand_path('templates', __dir__)
9
+
10
+ namespace 'witai:install'
11
+
12
+ def initializer
13
+ template 'config/initializers/wit.rb.tt'
14
+ end
15
+
16
+ def finalize
17
+ return unless behavior == :invoke
18
+
19
+ say_status 'notice', "Wit installed" +
20
+ "\n\t\tDo not forget to set adapt intent processor in application configuration" +
21
+ "\n\t\t\tconfig.enabled_intent_processors = [.., :wit, ..]", :green
22
+ end
23
+
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,8 @@
1
+ WitAI::Charyf::Extension.configure do
2
+ # Set to you Wit.AI App API Key
3
+ # As charyf uses wit only to determine intent you can use
4
+ # either server or client key
5
+ #
6
+ # config.api_key = 'PUMSOASDDB43HCJ3OMBOXKEENOOS92WDI6'
7
+ # PS: The key above is made up :)
8
+ end
@@ -1,5 +1,5 @@
1
1
  module WitAI
2
2
  module Charyf
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: witai-charyf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Ludvigh
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-30 00:00:00.000000000 Z
11
+ date: 2018-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: charyf
@@ -112,6 +112,8 @@ files:
112
112
  - bin/console
113
113
  - bin/setup
114
114
  - lib/witai/charyf.rb
115
+ - lib/witai/charyf/generators/install/install_generator.rb
116
+ - lib/witai/charyf/generators/install/templates/config/initializers/wit.rb.tt
115
117
  - lib/witai/charyf/processor.rb
116
118
  - lib/witai/charyf/version.rb
117
119
  - witai-charyf.gemspec