broqit/fields-ai
Laravel Nova field that brings AI to your admin forms, letting you generate and refine text content directly in fields. Adds configurable prompts/actions to speed up writing, editing, and content creation inside Nova resources.
fields-ai is a powerful FilamentPHP plugin that integrates AI-powered features directly into your Filament forms.
Support for Multiple OpenAI Endpoints:
gpt-4 and gpt-3.5-turbo, now use the Chat API endpoint, improving performance and response flexibility.gpt-3.5-turbo-instruct model will continue using the Completion API endpoint.Completion Models Now Considered Legacy:
gpt-3.5-turbo-instruct, are now considered legacy models.composer require broqit/fields-ai
php artisan fields-ai:install
This command will:
Fields AI Settings.openai-php/laravel Settings.OPENAI_API_KEY=sk-...
OPENAI_ORGANIZATION=org-...
The config/fields-ai.php file allows you to set default values and templates:
You can add AI generation capabilities to TextInput, Textarea, RichEditor, TinyEditor and EditorJS fields using the withAI() method:
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\RichEditor;
use Broqit\FilamentEditorJs\Forms\Components\EditorJs;
use Mohamedsabil83\FilamentFormsTinyeditor\Components\TinyEditor;
TextInput::make('title')
->withAI()
Textarea::make('description')
->withAI()
RichEditor::make('content')
->withAI()
EditorJS::make('content')
->withAI()
TinyEditor::make('content')
->withAI()
TextInput::make('title')
->withAI([
'model' => 'gpt-4',
'max_tokens' => 100,
'temperature' => 0.7,
])
Textarea::make('description')
->withAI([
'model' => 'gpt-3.5-turbo',
'max_tokens' => 200,
'temperature' => 0.5,
])
RichEditor::make('content')
->withAI([
'model' => 'gpt-4',
'max_tokens' => 500,
'temperature' => 0.8,
])
EditorJS::make('content')
->withAI([
'model' => 'gpt-4',
'max_tokens' => 500,
'temperature' => 0.8,
])
TinyEditor::make('content')
->withAI([
'model' => 'gpt-4',
'max_tokens' => 500,
'temperature' => 0.8,
])
The MIT License (MIT). Please see License File for more information.
How can I help you explore Laravel packages today?