level7up / ai-assistant
AI Assistant package for Laravel applications
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Language:Blade
pkg:composer/level7up/ai-assistant
Requires
- guzzlehttp/guzzle: ^7.0
This package is auto-updated.
Last update: 2025-12-17 11:25:48 UTC
README
A Laravel package that provides an AI-powered assistant widget for laravel applications.
Features
- 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
Installation
You can install the package via composer:
composer require level7up/ai-assistant
Configuration
Publish the configuration file:
php artisan vendor:publish --tag=ai-assistant-config
OpenAI API Key
Set 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.
Route Mappings
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 ],
Usage
Adding the Widget to Your Layout
Add the following Blade directives to your main layout file:
@aiAssistantWidgetCSS @aiAssistantWidget @aiAssistantWidgetJS
Make sure to include the CSS directive in the <head> section and the JS directive before the closing </body> tag.
Standalone Page
The package also provides a standalone page at /ai-assistant that can be accessed directly.
Customization
Translations
The package comes with English and Arabic translations. You can publish the translation files to customize them:
php artisan vendor:publish --tag=ai-assistant-translations
Views
You can publish the views to customize them:
php artisan vendor:publish --tag=ai-assistant-views
License
This package is open-sourced software licensed under the MIT license.