2017 © Pedro Peláez
 

library wit-php-sdk

This is a php sdk for the wit.ai API

image

wimkumpen/wit-php-sdk

This is a php sdk for the wit.ai API

  • Wednesday, April 20, 2016
  • by wimkumpen
  • Repository
  • 2 Watchers
  • 3 Stars
  • 34 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 2 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

PHP SDK FOR WIT.AI API

This is a php sdk for the wit.ai API. It's a slim version of the Facebook PHP SDK. Still work in progress... Only supports curl at this moment., (*1)

Setup:

Add a composer.json file to your project:, (*2)

{
  "require": {
      "wimkumpen/wit-php-sdk": "1.0.*"
  }
}

Then provided you have composer installed, you can run the following command:, (*3)

$ composer.phar install

That will fetch the library and its dependencies inside your vendor folder. Then you can add the following to your .php files in order to use the library, (*4)

require_once __DIR__.'/vendor/autoload.php';

Then you need to use the relevant classes, for example:, (*5)

use Wit\Wit;

Basic usage:

use Wit\Wit;
$app = new Wit(array(
    'default_access_token' => 'your_access_token')
);

$response = $app->get('/intents');
var_dump($response->getDecodedBody());

$data = [
    "name" => "flight_request",
    "doc"  => "detect flight request",
    "expressions" => [
        ["body" => "fly from incheon to sfo"],
        ["body" => "I want to fly from london to sfo"],
        ["body" => "need a flight from paris to tokyo"],
    ]
];

$response = $app->post('/intents', $data);
var_dump($response->getDecodedBody());

Todo:

  • [ ] Clean some code out;
  • [ ] Exceptions;
  • [ ] Get intent via speech (https://wit.ai/docs/http/20160330#get-intent-via-speech-link)
  • [ ] Implement other Http Clients;
  • [ ] Implement structured response;
  • [ ] Define requirements;

The Versions

20/04 2016

dev-master

9999999-dev https://github.com/wimkumpen/wit-php-sdk

This is a php sdk for the wit.ai API

  Sources   Download

MIT

The Requires

 

api php bot facebook wit.ai

20/04 2016

1.0.0

1.0.0.0 https://github.com/wimkumpen/wit-php-sdk

This is a php sdk for the wit.ai API

  Sources   Download

MIT

The Requires

 

api php bot facebook wit.ai