Fill Form Field Value with Suggestion from OpenAI API

Filament 4
Also available in Filament 3 version

This project demonstrates AI integration in Filament using OpenAI to automatically extract tags from job descriptions. An action button triggers OpenAI analysis, parses the response into tags, and auto-populates a Select field while creating any missing tags, providing a foundation for various AI-assisted data entry scenarios.

01JC09XBE9VVH07KE0KZ0BZVV4

Get the Source Code:

How it works

We have a simple form with a Multi-Select for Tags:

app/Filament/Resources/JobOffers/JobOfferResource.php

use Filament\Schemas\Schema;
use Filament\Support\Icons\Heroicon;
use App\Filament\Resources\JobOffers\Pages\ListJobOffers;
use App\Filament\Resources\JobOffers\Pages\CreateJobOffer;
use App\Filament\Resources\JobOffers\Pages\EditJobOffer;
use App\Models\JobOffer;
use Filament\Resources\Resource;
use Filament\Tables\Table;
use App\Filament\Resources\JobOffers\Schemas\JobOfferForm;
use App\Filament\Resources\JobOffers\Tables\JobOffersTable;
 
class JobOfferResource extends Resource
{
protected static ?string $model = JobOffer::class;
 
protected static string | \BackedEnum | null $navigationIcon = Heroicon::OutlinedRectangleStack;
 
public static function form(Schema $schema): Schema
{
return JobOfferForm::configure($schema);
}
 
public static function table(Table $table): Table
{
return JobOffersTable::configure($table);
}
 
public static function getRelations(): array
{
return [
//
];
}
 
public static function getPages(): array
{
return [
'index' => ListJobOffers::route('/'),
'create' => CreateJobOffer::route('/create'),
'edit' => EditJobOffer::route('/{record}/edit'),
];
}
}

And here we want to add a OpenAI query to extract these tags automatically using AI. So let's create our Action button:

The FULL tutorial is available after the purchase: in the Readme file of the official repository you would get invited to.
Get the Source Code: All 152 Premium Examples for $99