Download the PHP package pixelworxio/filament-ai-action without Composer
On this page you can find all versions of the php package pixelworxio/filament-ai-action. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pixelworxio/filament-ai-action
More information about pixelworxio/filament-ai-action
Files in pixelworxio/filament-ai-action
Package filament-ai-action
Short Description AI-powered actions for Filament v5 — streaming modal, structured output, intelligent table actions
License MIT
Informations about the package filament-ai-action
![]()
AI-powered actions for Filament v5 — streaming modal, structured output, and intelligent table actions.
Requirements
- PHP ^8.4
- Laravel ^12.0
- Filament ^5.0
- pixelworxio/laravel-ai-action ^1.0
Installation
Then register the plugin in your panel provider:
AiAction
AiAction extends Filament\Actions\Action and exposes seven fluent configuration methods.
agent()
Set the agent class to run:
stream()
Enable incremental text rendering in the modal:
withUserInstruction()
Show a free-text input in the modal before running the agent. The instruction is attached to the AgentContext as metadata:
persistResultTo()
Write the agent result to an Eloquent model column after successful execution. Structured results are JSON-encoded automatically:
queued()
Dispatch the agent as a background job instead of running inline. Accepts an optional queue name:
usingProvider()
Override the AI provider and model for this action only, ignoring the package-level defaults:
withContext()
Enrich the AgentContext before the agent runs. The callback receives the built context and the Eloquent record:
AiBulkAction
AiBulkAction extends Filament\Tables\Actions\BulkAction and uses the same fluent API. When queued, one RunAgentActionJob is dispatched per selected record.
AgentResultEntry
Render a persisted AI result inside a Filament infolist. Automatically detects whether the stored value is JSON (structured) or plain text:
->markdown()— passes the stored value throughStr::markdown()before rendering.->withRefreshAction()— embeds anAiActionbutton below the result to re-run and re-persist.
AiActionWidget
Embed an AI agent result directly on a Filament dashboard panel without a modal:
The widget respects Filament's $columnSpan property and renders inline using the same streaming-text or structured-output components.
Streaming
When ->stream() is enabled on AiAction, the AgentResponseModal Livewire component pushes response text to the browser in chunks using Livewire v4's stream() helper. A blinking cursor is shown while the response is incomplete. Use streaming for long responses where you want to show the user progress rather than waiting for a final result.
Structured Output
When an agent implements HasStructuredOutput from pixelworxio/laravel-ai-action, the modal and infolist entry render the result as a formatted definition list rather than plain text. Keys are converted from snake_case to Title Case. Array values are rendered as bulleted lists; integers and strings are rendered inline.
To store a structured result, use ->persistResultTo() — the value is JSON-encoded automatically. AgentResultEntry detects the JSON string and renders the structured view.
Testing
Use FakeAgentAction from the core package to test Filament actions without making real AI provider calls:
Config Reference
Publish the config file:
| Key | Env Variable | Default | Description |
|---|---|---|---|
default_label |
FILAMENT_AI_ACTION_LABEL |
'Ask AI' |
Default button label for AiAction and AiBulkAction |
show_usage |
FILAMENT_AI_ACTION_SHOW_USAGE |
false |
Show input/output token counts in the modal footer |
modal_size |
FILAMENT_AI_ACTION_MODAL_SIZE |
'xl' |
Filament modal width (sm, md, lg, xl, 2xl, etc.) |
allow_copy |
FILAMENT_AI_ACTION_ALLOW_COPY |
true |
Show a copy-to-clipboard button when the response is complete |
Publishing Assets
Publish the config file:
Publish the Blade views to customise the modal and components:
All versions of filament-ai-action with dependencies
laravel/framework Version ^12.0
filament/filament Version ^5.0
pixelworxio/laravel-ai-action Version ^1.0.0
spatie/laravel-package-tools Version ^1.16