Popularity
4.5
Declining
Activity
0.0
Stable
13
4
3

Programming language: Crystal
License: MIT License
Tags: Third-party APIs    
Latest version: v1.4.0

wit-crystal alternatives and similar shards

Based on the "Third-party APIs" category.
Alternatively, view wit-crystal alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of wit-crystal or a related project?

Add another 'Third-party APIs' Shard

README

wit-crystal

Crystal SDK for Wit.ai.

Supports Wit.ai API version 20160526. Runs on Crystal >= 0.17.2.

Installation

Add this to your application's shard.yml:

dependencies:
  wit:
    github: spalladino/wit-crystal

Examples

Understand

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}]

Context

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

Quickstart

The code for the quickstart weather application can be executed by running:

crystal examples/quickstart.cr <access-token>

Usage

wit-crystal provides a Wit::App class with the following methods:

  • message - the Wit message API
  • converse - the low-level Wit converse API
  • run_actions - a higher-level method to the Wit converse API
  • interactive - starts an interactive conversation with your bot

Refer to the examples folder for sample usage.

TODOs

  • Generate and upload documentation
  • Add more specs using webmock or similar tool

Acknowledgements

  • 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

Contributors

  • spalladino Santiago Palladino - creator, maintainer