NOTICE: Project has been superceded by Official Wit Ruby SDK
You should be using the new Wit SDK for Ruby referenced above. This repository is left for historical reasons.
This is an unnoficial Ruby wrapper for the Wit HTTP API. Wit turns natural language into structured data, this gem lets you use the Wit API from your Ruby app, provided you have a developer's access token.
Add this line to your application's Gemfile:
gem 'wit'
And then execute:
$ bundle
Or install it yourself as:
$ gem install wit
At time of writing, the only API method is message
.
require 'wit'
wit = Wit::Client.new '<Your API Key>'
puts wit.message("I need a bud right now")
A JSON Hash will be returned, like so:
{
"msg_id": "d953bd6c-c620-4dae-a3fc-7634b4330073",
"msg_body": "i need a bud right now!",
"outcome": {
"intent": "grab_me_something",
"entities": {
"object_to_grab": {
"value": "beer",
"start": 9,
"end": 12,
"body": "bud"
}
},
"confidence": 0.6310633902098893
}
}
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Copyright © 2013 Justin Workman
MIT License, see LICENSE.txt