1. Go to this page and download the library: Download laravilt/ai library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
laravilt / ai example snippets
use Laravilt\AI\AIAgent;
use Laravilt\Panel\Resources\Resource;
class ProductResource extends Resource
{
public static function ai(AIAgent $agent): AIAgent
{
return $agent
->name('product_assistant')
->description('AI assistant for managing products')
->searchable(['name', 'description', 'sku'])
->canCreate(true)
->canUpdate(true)
->canDelete(false)
->canQuery(true)
->systemPrompt('You are a helpful product management assistant.');
}
}