PHP code example of ercogx / filament-openai-assistant

1. Go to this page and download the library: Download ercogx/filament-openai-assistant library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ercogx / filament-openai-assistant example snippets


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

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



namespace App\Filament\Pages;

use Ercogx\FilamentOpenaiAssistant\Pages\OpenaiAssistantPage;

class ChatPage extends OpenaiAssistantPage
{
    
}

public function boot(): void
{
    \Ercogx\FilamentOpenaiAssistant\Services\ChatThreadModelServices::useChatThreadModel(\App\Models\MyChatThread::class);
}
bash
php artisan vendor:publish --tag="filament-openai-assistant-migrations"
bash
php artisan vendor:publish --tag="filament-openai-assistant-config"
bash
php artisan vendor:publish --tag="filament-openai-assistant-views"
bash
php artisan vendor:publish --tag="filament-openai-assistant-translations"