apiai

Crates.ioapiai
lib.rsapiai
version0.1.1
sourcesrc
created_at2017-03-05 13:15:54.099678
updated_at2017-03-05 14:01:23.128164
descriptionAPI.ai client library written in pure rust
homepage
repositoryhttps://github.com/ravenscroftj/apiai.rs
max_upload_size
id8828
size27,482
James Ravenscroft (ravenscroftj)

documentation

https://filamentai.github.io/apiai.rs/apiai/index.html

README

APIAI.rs

Build Status

A Rust client for api.ai chatbot API.

Still in early development - this library currently works on a a limited golden path when calling api.ai/query.

Usage

Add the following to your Cargo.toml:

[dependencies]
apiai = 0.1.1

Then import and use the crate in your module:

extern crate apiai;

A simple example call to API.ai might look like this:


let my_token = String::from("ce2f54f8eb444d74af85f89e30ef2fd3");

let client = ApiAIClient{
    access_token: my_token,
    ..Default::default()
};

let req = ApiRequest{
    query: Option::Some(String::from("Hello!")),
    ..Default::default()
};

let response = client.query(req).unwrap();

println!("{}", response.result.fulfillment.speech);

For more information see the botcmd example.

Commit count: 27

cargo fmt