PHPackages                             ediazaro/filament-chatgpt-agent - 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. [API Development](/categories/api)
4. /
5. ediazaro/filament-chatgpt-agent

ActiveLibrary[API Development](/categories/api)

ediazaro/filament-chatgpt-agent
===============================

Integrate with OpenAI ChatGPT

v4.0.1(6mo ago)047MITBladePHP &gt;=8.0

Since Nov 10Pushed 6mo agoCompare

[ Source](https://github.com/ediazaro/filament-chatgpt-agent)[ Packagist](https://packagist.org/packages/ediazaro/filament-chatgpt-agent)[ Docs](https://github.com/ediazaro/filament-chatgpt-agent)[ RSS](/packages/ediazaro-filament-chatgpt-agent/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (12)Versions (2)Used By (0)

ChatGPT Agent for Laravel Filament
==================================

[](#chatgpt-agent-for-laravel-filament)

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.

[![Latest Version on Packagist](https://camo.githubusercontent.com/b2f3b0a143933261233869b02b1f26f11723c0371fef44b3e107c5c3bc64be94/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c696b65616261732f66696c616d656e742d636861746770742d6167656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/likeabas/filament-chatgpt-agent)[![Total Downloads](https://camo.githubusercontent.com/1bfc6fc6efbff2740c54987d7c3a0c5337720eee96ba52204aa47e1c56b389c7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c696b65616261732f66696c616d656e742d636861746770742d6167656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/likeabas/filament-chatgpt-agent)

Preview:
--------

[](#preview)

Dark Mode: [![](https://raw.githubusercontent.com/likeabas/filament-chatgpt-agent/main/screenshots/darkmode.png)](https://raw.githubusercontent.com/likeabas/filament-chatgpt-agent/main/screenshots/darkmode.png)Select a text to quickly insert it: [![](https://raw.githubusercontent.com/likeabas/filament-chatgpt-agent/main/screenshots/select-to-insert.png)](https://raw.githubusercontent.com/likeabas/filament-chatgpt-agent/main/screenshots/select-to-insert.png)Light Mode: [![](https://raw.githubusercontent.com/likeabas/filament-chatgpt-agent/main/screenshots/lightmode.png)](https://raw.githubusercontent.com/likeabas/filament-chatgpt-agent/main/screenshots/lightmode.png)ChatGPT can read the page content for extra context: [![](https://raw.githubusercontent.com/likeabas/filament-chatgpt-agent/main/screenshots/page-watcher.png)](https://raw.githubusercontent.com/likeabas/filament-chatgpt-agent/main/screenshots/page-watcher.png)

Features
--------

[](#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-4o` or `gpt-4o-mini` and 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
-----------

[](#screenshots)

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

[](#installation)

You need to have [Laravel GPT from Malkuhr](https://github.com/maltekuhr/laravel-gpt) installed to use this package. If you haven't done so, follow the [installation instructions](https://github.com/maltekuhr/laravel-gpt?tab=readme-ov-file#installation):

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](https://platform.openai.com/account/org-settings).

```
OPENAI_ORGANIZATION=YOUR_ORGANIZATION_ID
OPENAI_API_KEY=YOUR_API_KEY
```

Now install this package:

```
composer require likeabas/filament-chatgpt-agent
```

Views
-----

[](#views)

Optionally, you can publish the views:

```
php artisan vendor:publish --tag="chatgpt-agent-views"
```

Translations
------------

[](#translations)

Optionally, you can publish translations:

```
php artisan vendor:publish --tag="chatgpt-agent-translations"
```

Usage
-----

[](#usage)

### 1. Adding the Plugin to Filament Panel

[](#1-adding-the-plugin-to-filament-panel)

Modify your Filament [Panel Configuration](https://laravel-filament.cn/docs/en/3.x/panels/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:

[](#2-you-can-customize-the-plugin-using-the-available-options)

Also see [all available options](#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](#translations).

See the [full list of available options](#available-options)

### 3. Blade Component Usage

[](#3-blade-component-usage)

You can embed the ChatGPT agent in any Blade file:

```

    @livewire('filament-chatgpt-agent')

```

> This works for all Livewire pages in any Laravel project, not just Filament. Ensure Tailwind CSS, Filament, and Livewire are properly imported.

```

    ...

    @livewire('filament-chatgpt-agent')

```

Available Options
-----------------

[](#available-options)

OptionTypeDefaultDescription`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](#using-laravel-gpt-functions)`defaultPanelWidth()``string,Closure``'350px'`Sets the chat panel width.`pageWatcherEnabled()``bool,Closure``false`See the [Page wachter](#page-watcher) 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
---------------------------

[](#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](https://github.com/maltekuhr/laravel-gpt) for more details.

Page Watcher
------------

[](#page-watcher)

[![](https://raw.githubusercontent.com/likeabas/filament-chatgpt-agent/main/screenshots/page-watcher.png)](https://raw.githubusercontent.com/likeabas/filament-chatgpt-agent/main/screenshots/page-watcher.png)

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

[](#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

[](#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
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- Package created by [Bas Schleijpen](https://github.com/likeabas).
- The view and livewire component structure was inspired by [Martin Hwang](https://github.com/icetalker).
- [All Contributors](../../contributors)

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance68

Regular maintenance activity

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

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

Unknown

Total

1

Last Release

184d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/97184fa8b835bc3a28d4a7cc9118f778ab9cdd702ad0b7c97aa60b2134b64e9f?d=identicon)[ediazaro](/maintainers/ediazaro)

---

Top Contributors

[![likeabas](https://avatars.githubusercontent.com/u/4509314?v=4)](https://github.com/likeabas "likeabas (5 commits)")[![ediazaro](https://avatars.githubusercontent.com/u/159196692?v=4)](https://github.com/ediazaro "ediazaro (2 commits)")

---

Tags

laravellikeabasfilament-chatgpt-agent

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/ediazaro-filament-chatgpt-agent/health.svg)

```
[![Health](https://phpackages.com/badges/ediazaro-filament-chatgpt-agent/health.svg)](https://phpackages.com/packages/ediazaro-filament-chatgpt-agent)
```

###  Alternatives

[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.0k7.8M57](/packages/dedoc-scramble)[likeabas/filament-chatgpt-agent

Integrate with OpenAI ChatGPT

235.3k](/packages/likeabas-filament-chatgpt-agent)[scalar/laravel

Render your OpenAPI-based API reference

6183.9k2](/packages/scalar-laravel)[ryangjchandler/bearer

Minimalistic token-based authentication for Laravel API endpoints.

8129.8k](/packages/ryangjchandler-bearer)[combindma/laravel-facebook-pixel

Meta pixel integration for Laravel

4956.9k](/packages/combindma-laravel-facebook-pixel)[stechstudio/laravel-hubspot

A Laravel SDK for the HubSpot CRM Api

2971.0k](/packages/stechstudio-laravel-hubspot)

PHPackages © 2026

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