ediazaro/filament-chatgpt-agent
Composer 安装命令:
composer require ediazaro/filament-chatgpt-agent
包简介
Integrate with OpenAI ChatGPT
README 文档
README
Filament ChatGPT Agent is a Filament plugin that allows you to easily integrate ChatGPT into your Filament project, enabling ChatGPT to access context information from your project by creating GPT functions.
Preview:
Dark Mode:
Select a text to quickly insert it:
Light Mode:
ChatGPT can read the page content for extra context:

Features
I asked ChatGPT to generate a full list of the plugin features:
- Seamless ChatGPT Integration: Easily integrates OpenAI’s ChatGPT into your Filament project.
- Customizable Chat Interface: Modify bot name, button text, panel width, and more.
- Select To Insert: Select some text on the page and insert that with one click.
- Supports Laravel GPT Functions: Define and register custom GPT functions to enhance AI capabilities.
- Page Watcher: Sends the page content and URL to ChatGPT for better contextual responses.
- Configurable OpenAI Model: Choose different models like
gpt-4oorgpt-4o-miniand control temperature and token usage. - Custom System Message: Define how the AI should behave using a system instruction.
- Full Screen Mode: The more space the better.
- Dark Mode Support: Specially tailored to night owls.
Screenshots
Installation
You need to have Laravel GPT from Malkuhr installed to use this package. If you haven't done so, follow the installation instructions:
You can install the package via composer:
composer require maltekuhr/laravel-gpt:^0.1.5
Next you need to configure your OpenAI API Key and Organization ID. You can find both in the OpenAI Dashboard.
OPENAI_ORGANIZATION=YOUR_ORGANIZATION_ID OPENAI_API_KEY=YOUR_API_KEY
Now install this package:
composer require likeabas/filament-chatgpt-agent
Views
Optionally, you can publish the views:
php artisan vendor:publish --tag="chatgpt-agent-views"
Translations
Optionally, you can publish translations:
php artisan vendor:publish --tag="chatgpt-agent-translations"
Usage
1. Adding the Plugin to Filament Panel
Modify your Filament Panel Configuration to include the plugin:
use LikeABas\FilamentChatgptAgent\ChatgptAgentPlugin; public function panel(Panel $panel): Panel { return $panel ... ->plugin( ChatgptAgentPlugin::make() ) ... }
2. You can customize the plugin using the available options:
Also see all available options below.
use App\GPT\Functions\YourCustomGPTFunction; use LikeABas\FilamentChatgptAgent\ChatgptAgentPlugin; ... public function panel(Panel $panel): Panel { return $panel ... ->plugin( ChatgptAgentPlugin::make() ->defaultPanelWidth('400px') // default 350px ->botName('GPT Assistant') ->model('gpt-4o') ->buttonText('Ask ChatGPT') ->buttonIcon('heroicon-m-sparkles') // System instructions for the GPT ->systemMessage('Act nice and help') // Array of GPTFunctions the GPT can use ->functions([ new YourCustomGPTFunction(), ]) // Default start message, set to false to not show a message ->startMessage('Hello sir! How can I help you today?') ->pageWatcherEnabled(true) ) ... }
Other language strings can be altered in the translations file. Just publish the translations.
See the full list of available options
3. Blade Component Usage
You can embed the ChatGPT agent in any Blade file:
<body> @livewire('filament-chatgpt-agent') </body>
This works for all Livewire pages in any Laravel project, not just Filament. Ensure Tailwind CSS, Filament, and Livewire are properly imported.
<body> ... @livewire('filament-chatgpt-agent') </body>
Available Options
| Option | Type | Default | Description |
|---|---|---|---|
enabled() |
bool,Closure |
auth()->check() |
Enables or disables the ChatGPT agent. |
botName() |
string,Closure |
'ChatGPT Agent' |
Sets the displayed name of the bot. |
buttonText() |
string,Closure |
'Ask ChatGPT' |
Customizes the button text. |
buttonIcon() |
string,Closure |
'heroicon-m-sparkles' |
Defines the button icon. |
sendingText() |
string,Closure |
'Sending...' |
Text displayed while sending a message. |
model() |
string,Closure |
'gpt-4o-mini' |
Defines the ChatGPT model used. |
temperature() |
float,Closure |
0.7 |
Controls response randomness. Lower is more deterministic. 0-2. |
maxTokens() |
int,Closure |
null |
Limits the token count per response. null is no limit. |
systemMessage() |
string,Closure |
'' |
Provides system instructions for the bot. |
functions() |
array,Closure |
[] |
Defines callable GPT functions. See Using Laravel GPT Functions |
defaultPanelWidth() |
string,Closure |
'350px' |
Sets the chat panel width. |
pageWatcherEnabled() |
bool,Closure |
false |
See the Page wachter option. |
pageWatcherSelector() |
string,Closure |
'.fi-page' |
Sets the CSS selector for the page watcher. |
pageWatcherMessage() |
string,Closure,null |
null |
Message displayed when the page changes. |
startMessage() |
string,bool,Closure |
false |
Default message on panel open. Set to false to disable. |
logoUrl() |
string,bool,Closure |
false |
Overwrite the chat avatar / logo. Set to false to show a default GPT icon. |
Using Laravel GPT Functions
Laravel GPT allows you to define custom GPTFunctions that ChatGPT can call to execute tasks within your application. This is useful for integrating dynamic data retrieval, calculations, or external API calls into the ChatGPT responses.
Refer to the Laravel GPT documentation for more details.
Page Watcher
The Page Watcher feature allows the ChatGPT agent to receive additional context about the current page by including the .innerText of a specified page element (default: .fi-page, the Filament page container) along with the page URL in each message sent to ChatGPT. This helps provide better contextual responses based on the page content.
Privacy Considerations
Use this feature with caution. Since the entire page content (or the selected element's content) is sent to ChatGPT, users should be informed of this behavior. The pageWatcherEnabled option supports a closure, allowing you to provide an opt-in mechanism for users.
Enabling Page Watcher
To enable the Page Watcher feature, set the pageWatcherEnabled option to true and define a selector for the element to monitor:
public function panel(Panel $panel): Panel { return $panel ->plugin( ChatgptAgentPlugin::make() ->pageWatcherEnabled(true) // Enable page watcher ->pageWatcherSelector('.custom-content') // Specify the selector ->pageWatcherMessage( "This is the plain text the user can see on the page, use it as additional context for the previous message:\n\n" ) // Optional custom message for ChatGPT ); }
Alternatively, you can use a closure to enable the feature conditionally, such as requiring users to opt-in:
public function panel(Panel $panel): Panel { return $panel ->plugin( ChatgptAgentPlugin::make() ->pageWatcherEnabled(fn () => auth()->user()->settings['enable_page_watcher'] ?? false) // User opt-in ->pageWatcherSelector('.fi-page') ); }
Changelog
Please see CHANGELOG for more information on what has changed recently.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Package created by Bas Schleijpen.
- The view and livewire component structure was inspired by Martin Hwang.
- All Contributors
ediazaro/filament-chatgpt-agent 适用场景与选型建议
ediazaro/filament-chatgpt-agent 是一款 基于 Blade 开发的 Composer 扩展包,目前已累计 195 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 11 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「likeabas」 「filament-chatgpt-agent」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ediazaro/filament-chatgpt-agent 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ediazaro/filament-chatgpt-agent 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ediazaro/filament-chatgpt-agent 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Integrate with OpenAI ChatGPT
Alfabank REST API integration
Laravel package for Accurate Online API integration.
Shared RCX Laravel DataTables UI and configuration helpers.
Boot a Laravel project on any machine with one command: app:serve installs missing tools (PHP, Node, Composer, Herd, Docker), creates .env, sets up the database, runs migrations, builds assets, starts a queue worker and serves via Herd, Sail or artisan serve; app:down cleanly stops everything it sta
Branded, diagnostic error pages (500, 403, 404, 419, 503) for Filament — native Filament UI, dark mode and translations out of the box.
统计信息
- 总下载量: 195
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 22
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-11-10