PHPackages                             raulmangolin/wit-php - 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. [API Development](/categories/api)
4. /
5. raulmangolin/wit-php

ActiveLibrary[API Development](/categories/api)

raulmangolin/wit-php
====================

Wit.ai php sdk

1.0.0(5y ago)0153MITPHPPHP &gt;=5.5.0

Since Feb 2Pushed 5y agoCompare

[ Source](https://github.com/raulmangolin/wit-php)[ Packagist](https://packagist.org/packages/raulmangolin/wit-php)[ RSS](/packages/raulmangolin-wit-php/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

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

[](#witai-php-sdk)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/6a7156c53423c88a3de947811d45f6e79a1270727f0b2f0324beb77c655bd669/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7261756c6d616e676f6c696e2f7769742d7068702f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/raulmangolin/wit-php/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/dc03667f4672f801a8e8bb90804544ff4f8c54dc9e1ebd1c52492b6535e77543/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7261756c6d616e676f6c696e2f7769742d7068702f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/raulmangolin/wit-php/?branch=master)[![Build Status](https://camo.githubusercontent.com/c076bb5106286058d5b3d0d1adb842a81592229f3b8e233a74acfbeb72332888/68747470733a2f2f7472617669732d63692e6f72672f7261756c6d616e676f6c696e2f7769742d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/raulmangolin/wit-php)

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 tgallice/wit-php

```

Usage:
------

[](#usage)

Using the low level `Client`:

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

use Tgallice\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 Tgallice\Wit\Client;
use Tgallice\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 Tgallice\Wit\Model\Step\Action;
use Tgallice\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 Tgallice\Wit\Client;
use Tgallice\Wit\ConverseApi;
use Tgallice\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`.

Some examples are describe in the [tgallice/php-wit-example](https://github.com/tgallice/wit-php-example) repository.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 76.9% 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

1927d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b1692bfc3172c3ad5df35143d7e3d2a5d821f2709880b9a76b38c788fc2fe9cf?d=identicon)[raulmangolin](/maintainers/raulmangolin)

---

Top Contributors

[![tgallice](https://avatars.githubusercontent.com/u/860533?v=4)](https://github.com/tgallice "tgallice (20 commits)")[![raulmangolin](https://avatars.githubusercontent.com/u/330166?v=4)](https://github.com/raulmangolin "raulmangolin (4 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/raulmangolin-wit-php/health.svg)

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

###  Alternatives

[tgallice/wit-php

Wit.ai php sdk

7325.2k1](/packages/tgallice-wit-php)[longman/telegram-bot

PHP Telegram bot

4.0k2.1M50](/packages/longman-telegram-bot)[linecorp/line-bot-sdk

SDK of the LINE BOT API for PHP

7323.0M21](/packages/linecorp-line-bot-sdk)[iboldurev/dialogflow

Dialogflow php sdk

16540.5k1](/packages/iboldurev-dialogflow)[klev-o/telegram-bot-api

Simple and convenient object-oriented implementation Telegram bot API with php version ^7.4 support. You'll like it)

457.8k1](/packages/klev-o-telegram-bot-api)[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)
