A Laravel package that provides an AI-powered assistant widget for laravel applications.
- Floating chat widget that can be embedded anywhere in your application
- Natural language processing using OpenAI API
- Fallback to direct keyword matching when AI is not available
- RTL (Right-to-Left) language support
- Customizable route mappings
- Responsive design
You can install the package via composer:
composer require level7up/ai-assistantPublish the configuration file:
php artisan vendor:publish --tag=ai-assistant-configSet your OpenAI API key in your .env file:
OPENAI_API_KEY=your-api-key
If the API key is not provided, the assistant will fall back to direct keyword matching.
Edit the config/ai-assistant.php file to customize the route mappings:
'route_mappings' => [
'create purchase' => [
'route' => 'purchases.create',
'label' => 'Create Purchase'
],
// Add more mappings as needed
],Add the following Blade directives to your main layout file:
@aiAssistantWidgetCSS
@aiAssistantWidget
@aiAssistantWidgetJSMake sure to include the CSS directive in the <head> section and the JS directive before the closing </body> tag.
The package also provides a standalone page at /ai-assistant that can be accessed directly.
The package comes with English and Arabic translations. You can publish the translation files to customize them:
php artisan vendor:publish --tag=ai-assistant-translationsYou can publish the views to customize them:
php artisan vendor:publish --tag=ai-assistant-viewsThis package is open-sourced software licensed under the MIT license.