PHPackages                             garissman/wit - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. garissman/wit

ActiveLibrary

garissman/wit
=============

Wit.ai php sdk

1.0(1y ago)05MITPHPPHP &gt;=8.0

Since Aug 29Pushed 1y agoCompare

[ Source](https://github.com/garissman/wit)[ Packagist](https://packagist.org/packages/garissman/wit)[ RSS](/packages/garissman-wit/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Wit.ai PHP sdk
==============

[](#witai-php-sdk)

This is an unofficial php sdk for [Wit.ai](https://wit.ai) and it's still in progress...

```
Wit.ai: Easily create text or voice based bots that humans can chat with on their preferred messaging platform.

```

\## Install:

Via composer:

```
$ composer require garissman/wit

```

Usage:
------

[](#usage)

Using the low level `Client`:

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

use Garissman\Wit\Client;

$client = new Client('app_token');

$response = $client->get('/message', [
    'q' => 'Hello I live in London',
]);

// Get the decoded body
$intent = json_decode((string) $response->getBody(), true);
```

You can used the `Message` api class to extract meaning of a sentence:

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

use Garissman\Wit\Client;
use Garissman\Wit\MessageApi;

$client = new Client('app_token');
$api = new MessageApi($client);

$meaning = $api->extractMeaning('Hello I live in London');
```

Conversation
------------

[](#conversation)

The `Conversation` class provides an easy way to use the `converse` api and execute automatically the chaining steps :

First, you need to create an `ActionMapping` class to customize the actions behavior.

```
namespace Custom;

use Garissman\Wit\Model\Step\Action;
use Garissman\Wit\Model\Step\Message;

class MyActionMapping extends ActionMapping
{
    /**
     * @inheritdoc
     */
    public function action($sessionId, Context $context, Action $step)
    {
        return call_user_func_array(array($this, $step->getAction()), array($sessionId, $context));
    }

    /**
     * @inheritdoc
     */
    public function say($sessionId, Context $context, Message $step)
    {
        echo $step->getMessage();
    }

     ....
}
```

And using it in the `Conversation` class.

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

use Garissman\Wit\Client;
use Garissman\Wit\ConverseApi;
use Garissman\Wit\Conversation;
use Custom\MyActionMapping;

$client = new Client('app_token');
$api = new ConverseApi($client);
$actionMapping = new MyActionMapping();
$conversation = new Conversation($api, $actionMapping);

$context = $conversation->converse('session_id', 'Hello I live in London');
```

`Conversation::converse()` return the last available `Context`.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 62.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

627d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/593dcaa71a21eb1e1f8c0774f439017bfcbcf50a7eeca923823a7e8407de0779?d=identicon)[arimoralesjordan](/maintainers/arimoralesjordan)

---

Top Contributors

[![tgallice](https://avatars.githubusercontent.com/u/860533?v=4)](https://github.com/tgallice "tgallice (20 commits)")[![garissman](https://avatars.githubusercontent.com/u/7206453?v=4)](https://github.com/garissman "garissman (10 commits)")[![hfinck](https://avatars.githubusercontent.com/u/661811?v=4)](https://github.com/hfinck "hfinck (2 commits)")

---

Tags

botchatbotwit.aiwit.ai sdkchat bot

### Embed Badge

![Health badge](/badges/garissman-wit/health.svg)

```
[![Health](https://phpackages.com/badges/garissman-wit/health.svg)](https://phpackages.com/packages/garissman-wit)
```

###  Alternatives

[tgallice/wit-php

Wit.ai php sdk

7325.2k1](/packages/tgallice-wit-php)[botman/botman

Create messaging bots in PHP with ease.

6.2k1.5M97](/packages/botman-botman)[nutgram/nutgram

The Telegram bot library that doesn't drive you nuts

714214.9k8](/packages/nutgram-nutgram)[guanguans/notify

Push notification SDK(AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、PushMe、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、ZohoCliq、ZohoCliqWebHook、Zulip).

682104.9k7](/packages/guanguans-notify)[digitalstars/simplevk

Powerful PHP library/framework for VK API bots, supporting LongPoll &amp; Callback &amp; OAuth

883.9k3](/packages/digitalstars-simplevk)[bushlanov-dev/max-bot-api-client-php

Max Bot API Client library

281.6k](/packages/bushlanov-dev-max-bot-api-client-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
