Auto Description
This module enables AI-powered automatic description generation.
Features
- Auto-Generate Descriptions - Automatically create descriptions for products, tasks, and other entities
- Multiple Content Types - Support for various entity types across the system
- Customizable Tone - Configure formal, casual, or technical writing styles
- Multi-Language - Generate descriptions in multiple languages
- Batch Processing - Generate descriptions for multiple items at once
Requirements
| Requirement | Details |
|---|---|
| Dependencies | AICore |
| PHP Version | 8.2+ |
| AI Provider | At least one AI provider configured in AI Core |
Installation
- Ensure AI Core module is installed and enabled
- Enable the Auto Description module in Settings > Modules
- Configure description templates and default settings
Configuration
Navigate to Settings > AI Core > Auto Description to configure:
- Default Tone - Set default writing style (formal, casual, technical)
- Description Length - Configure default description lengths
- Supported Entities - Enable auto-description for specific entity types
- Language - Set default language for generated descriptions
Usage
Generate Description for Product
use Modules\AutoDescription\Services\AutoDescriptionService;
$autoDesc = app(AutoDescriptionService::class);
$description = $autoDesc->generate([
'entity_type' => 'product',
'name' => 'Wireless Bluetooth Headphones',
'attributes' => [
'brand' => 'AudioMax',
'features' => ['noise cancelling', '30hr battery', 'foldable'],
'price' => 149.99,
],
'tone' => 'professional',
'length' => 'medium',
]);
Generate Task Description
$description = $autoDesc->generate([
'entity_type' => 'task',
'title' => 'Update customer database',
'context' => 'We need to migrate customer records to the new CRM system',
'tone' => 'technical',
]);
Batch Generation
$descriptions = $autoDesc->generateBatch([
'entity_type' => 'product',
'items' => [
['name' => 'Product A', 'attributes' => [...]],
['name' => 'Product B', 'attributes' => [...]],
['name' => 'Product C', 'attributes' => [...]],
],
]);
Multi-Language Generation
$description = $autoDesc->generate([
'entity_type' => 'product',
'name' => 'Smart Watch Pro',
'attributes' => [...],
'languages' => ['en', 'ar', 'es'],
]);
// Returns descriptions in all requested languages
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/auto-description/generate | Generate description |
| POST | /api/v1/auto-description/batch | Batch generate descriptions |
| GET | /api/v1/auto-description/templates | List description templates |
Supported Entity Types
| Entity | Description |
|---|---|
| Product | E-commerce and inventory products |
| Task | Project and task management items |
| Job | Job postings and positions |
| Event | Calendar events and meetings |
| Document | Document summaries and abstracts |
| Custom | Any custom entity type |
Description Lengths
| Length | Approximate Words |
|---|---|
| Short | 20-50 words |
| Medium | 50-150 words |
| Long | 150-300 words |
| Custom | Specify word count |
Notes
- Generated descriptions can be edited before saving
- Supports SEO-optimized descriptions for products
- Templates can be customized for organization-specific needs
- Usage is tracked through AI Core's usage monitoring