PHPackages                             ercogx/filament-openai-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ercogx/filament-openai-assistant

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ercogx/filament-openai-assistant
================================

Create chat page with OpenAI Assistant

1.1.1(1y ago)185.6k↓66.7%6MITPHPCI passing

Since Jun 25Pushed 2mo ago2 watchersCompare

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

READMEChangelogDependencies (11)Versions (9)Used By (0)

OpenAI Assistant Integration
============================

[](#openai-assistant-integration)

Filament OpenAI Assistant is a filament plugin that adds a chat page with an Open AI assistant

Preview: [![](https://raw.githubusercontent.com/ercogx/filament-openai-assistant/main/screenshots/preview.png)](https://raw.githubusercontent.com/ercogx/filament-openai-assistant/main/screenshots/preview.png)Dark Mode: [![](https://raw.githubusercontent.com/ercogx/filament-openai-assistant/main/screenshots/dark-mode.png)](https://raw.githubusercontent.com/ercogx/filament-openai-assistant/main/screenshots/dark-mode.png)

Feature
-------

[](#feature)

- Integrate with OpenAI Assistant
- Easy to Setup
- Multiple Assistants
- Multiple Threads
- Support for dark mode

Usage
-----

[](#usage)

### Installation

[](#installation)

First, you need install the package via composer:

```
composer require ercogx/filament-openai-assistant
```

### Publish Migration

[](#publish-migration)

Then need publish migration:

```
php artisan vendor:publish --tag="filament-openai-assistant-migrations"
```

Optional you can change foreign id for auth user if you use a different model instead of the `\App\Models\User::class`

### Publish Config

[](#publish-config)

Next, you can publish the config files with:

```
php artisan vendor:publish --tag="filament-openai-assistant-config"
```

This will create a `config/filament-openai-assistant.php` configuration file in your project, which you can modify to your needs using environment variables:

```
OPENAI_API_KEY=sk-***
OPENAI_ASSISTANT_ID=asst_***
OPENAI_ASSISTANT_NAME=Assistant

```

You can also add more assistants to the `assistants` array as needed

### Add To Filament Panels

[](#add-to-filament-panels)

The last step add the Plugin to your Panel's configuration. This will register the plugin's page with the Panel.

```
public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            \Ercogx\FilamentOpenaiAssistant\OpenaiAssistantPlugin::make()
        ]);
}
```

You can also change the chat page to customize it

```
\Ercogx\FilamentOpenaiAssistant\OpenaiAssistantPlugin::make()
    ->setRegistrablePages([
        \App\Filament\Pages\ChatPage::class
    ])
```

```
