PHPackages                             dragonzap/openai-chatgpt-assistant - 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. dragonzap/openai-chatgpt-assistant

ActiveLibrary

dragonzap/openai-chatgpt-assistant
==================================

Provides clean abstraction for the chatgpt assistant API. Build and run assistants with a clean easy to use design

v2.2.1(1y ago)098[1 issues](https://github.com/dragonzapeducation/chatgpt-assistant/issues)GPL-2.0-or-laterPHP

Since Dec 3Pushed 1y ago1 watchersCompare

[ Source](https://github.com/dragonzapeducation/chatgpt-assistant)[ Packagist](https://packagist.org/packages/dragonzap/openai-chatgpt-assistant)[ RSS](/packages/dragonzap-openai-chatgpt-assistant/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (12)Used By (0)

chatgpt-assistant
=================

[](#chatgpt-assistant)

Provides clean abstraction layer for the chatgpt assistant API. Build and run assistants with a clean easy to use design, compatible with raw PHP and also Laravel framework.

[Documentation for Installation on Laravel framework](https://github.com/dragonzapeducation/chatgpt-assistant-examples/tree/main/laravel10-api-app) -- Now compatible with Laravel 9, 10, 11 and 12

[Documentation for Installation without Laravel framework](https://github.com/dragonzapeducation/chatgpt-assistant-examples/tree/main/JustSimplePhp)

Installation
------------

[](#installation)

To install the ChatGPT Assistant wrapper, use Composer. Run the following command in your project directory:

```
composer require dragonzap/openai-chatgpt-assistant
```

Simple Usage
------------

[](#simple-usage)

```
// Replace the API Key with your own chatgpt API key
$assistant = new JessicaAssistant(new APIConfiguration('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'));
$conversation = $assistant->newConversation();

while(1)
{
    $input_message = fgets(STDIN);
    echo 'User:' . $input_message . "\n";
    $conversation->sendMessage($input_message);
    $conversation->blockUntilResponded();

    echo 'Assistant: ' . $conversation->getResponseData()->getResponse() . "\n";

}
```

JessicaAssistant will override the `handleFunction()` method which will be called by ChatGPT when ChatGPT needs to execute functions

```
 public function handleFunction(string $function, array $arguments): string|array
    {
        $response = [];

        switch($function)
        {
            case 'get_weather':
                $response = ['success' => true, 'message' => 'We will pretend its a sunny day where ever you live'];
                break;

            default:
                $response = [
                    'success' => false,
                    'message' => 'Unknown function'
                ];
        }
        return $response;
    }
```

The `handleFunction` method will respond with the message to send back to ChatGPT both strings and arrays are allowed. See the full implementation of Jessica Assistant here:

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance47

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

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

Every ~50 days

Recently: every ~120 days

Total

11

Last Release

392d ago

Major Versions

v0.2.0 → v1.0.02023-12-04

v1.2.0 → v2.0.02023-12-22

### Community

Maintainers

![](https://www.gravatar.com/avatar/92cec60df55c5baae3c5b505216ad0033682404b41a6ad757f3e03d9560cd92e?d=identicon)[DragonZap](/maintainers/DragonZap)

---

Top Contributors

[![dragonzapeducation](https://avatars.githubusercontent.com/u/80857742?v=4)](https://github.com/dragonzapeducation "dragonzapeducation (43 commits)")

### Embed Badge

![Health badge](/badges/dragonzap-openai-chatgpt-assistant/health.svg)

```
[![Health](https://phpackages.com/badges/dragonzap-openai-chatgpt-assistant/health.svg)](https://phpackages.com/packages/dragonzap-openai-chatgpt-assistant)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[typicms/base

A modular multilingual CMS built with Laravel, enabling developers to manage structured content like pages, news, events, and more.

1.6k20.3k](/packages/typicms-base)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)

PHPackages © 2026

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