1. Go to this page and download the library: Download darkclow4/filament-chatbot 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/ */
namespace App\Providers\Filament;
use Darkclow4\FilamentChatbot\ChatbotPlugin;
use Filament\Panel;
use Filament\PanelProvider;
class AdminPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
->default()
->id('admin')
->path('admin')
->plugin(ChatbotPlugin::make());
}
}
return [
'enabled' => true,
'streaming' => false,
'draggable' => false,
'title' => 'AI Assistant',
'description' => 'Ask anything about this app.',
'placeholder' => 'Type your message...',
'empty_state_heading' => 'Need a hand?',
'empty_state_description' => 'Ask for help with data, workflow, or admin tasks.',
'send_button_label' => 'Send',
'new_chat_label' => 'New chat',
'agent' => Darkclow4\FilamentChatbot\Ai\Agents\FilamentChatbotAgent::class,
'provider' => null,
'model' => null,
'max_messages' => 100,
];
'agent' => App\Ai\Agents\AdminPanelAgent::class,
namespace App\Ai\Agents;
use Laravel\Ai\Concerns\RemembersConversations;
use Laravel\Ai\Contracts\Agent;
use Laravel\Ai\Contracts\Conversational;
use Laravel\Ai\Promptable;
class AdminPanelAgent implements Agent, Conversational
{
use Promptable;
use RemembersConversations;
public function instructions(): string
{
return 'You are a helpful admin assistant for our Filament panel.';
}
}