Supports Wit.ai API version 20160526
.
Runs on Crystal >= 0.17.2
.
Add this to your application's shard.yml
:
dependencies:
wit:
github: spalladino/wit-crystal
A query to the /message
endpoint can be issued by running:
crystal examples/understand.cr <access-token> In Buenos Aires
> Extracted entities from 'In Buenos Aires'
> location=[{"confidence" => 0.957859, "type" => "value", "value" => "Buenos Aires", "suggested" => true}]
Shows how using a context changes how message entities are understood, by processing message Last week both with and without a reference time.
crystal examples/context.cr <access-token>
> Understanding message 'Last week'
> Without context: 2016-05-09T00:00:00.000-07:00
> Ref 2012-03-08: 2012-02-27T00:00:00.000Z
The code for the quickstart weather application can be executed by running:
crystal examples/quickstart.cr <access-token>
wit-crystal
provides a Wit::App
class with the following methods:
message
- the Wit message APIconverse
- the low-level Wit converse APIrun_actions
- a higher-level method to the Wit converse APIinteractive
- starts an interactive conversation with your bot
Refer to the examples folder for sample usage.
- Generate and upload documentation
- Add more specs using webmock or similar tool
- The Wit.ai team for building such an awesome tool
- The developers of the Ruby SDK for Wit.ai, on which this library is heavily inspired
- spalladino Santiago Palladino - creator, maintainer