// config/filament-rich-editor-source-ai.php
'prompts' => [
'remove-inline-styles' => [
'label' => 'Remove Inline Styles',
'description' => 'Strip all inline styles from HTML',
'prompt' => 'Remove all inline style attributes from the HTML while preserving the structure and content.',
],
'improve-accessibility' => [
'label' => 'Improve Accessibility',
'description' => 'Enhance HTML for WCAG compliance',
'prompt' => 'Transform this HTML to meet WCAG 2.1 AA standards. Add proper ARIA labels, ensure semantic HTML, and improve accessibility.',
],
'convert-to-semantic-html' => [
'label' => 'Semantic HTML Conversion',
'description' => 'Convert divs to semantic HTML5 elements',
'prompt' => 'Convert this HTML to use semantic HTML5 elements (article, section, aside, nav, etc.) instead of generic divs where appropriate.',
],
'minify-html' => [
'label' => 'Minify HTML',
'description' => 'Remove unnecessary whitespace and comments',
'prompt' => 'Minify this HTML by removing unnecessary whitespace, comments, and optimizing the structure while keeping it readable.',
],
];
// config/filament-rich-editor-source-ai.php
'default' => [
'provider' => Provider::Anthropic, // or Provider::OpenAI, Provider::Ollama, etc.
'model' => 'claude-3-5-sonnet-20241022',
],
use Prism\Prism\Enums\Provider;
return [
// Default AI provider and model
'default' => [
'provider' => Provider::OpenAI,
'model' => 'gpt-4o-mini',
],
// System prompt used for all AI transformations
'system-prompt' => 'You are an expert HTML content transformer...',
// Available transformation prompts
'prompts' => [
'tailwind-css-typography-optimization' => [
'label' => 'Tailwind CSS Typography optimization',
'description' => 'Optimize HTML content for Tailwind CSS typography plugin (prose)',
'prompt' => 'cleanup this file - Tailwindcss typography plugin (prose) is used...',
],
// Add your custom prompts here
],
];
'system-prompt' => 'You are an expert HTML content transformer specialized in creating clean, accessible, and modern web content. Transform HTML according to the given instructions while maintaining semantic meaning and improving code quality.',
// resources/lang/en/editor.php
return [
'source' => 'HTML Source',
'transform-html' => 'Transform HTML',
'exit_source' => 'Exit HTML Source',
'transform-html-modal' => [
'heading' => 'Transform HTML using AI',
'prompt-label' => 'Select prompt',
'prompt-helper-text' => 'Choose a prompt that will be used to transform the HTML content.',
'html-content-label' => 'HTML Content',
'html-content-helper-text' => 'This is the HTML content from your editor.',
'transform-button' => 'Transform HTML',
'submit-label' => 'Insert into Editor',
'prompt-