1. Go to this page and download the library: Download oi-lab/oi-laravel-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/ */
use OiLab\OiLaravelAi\Data\AiPromptVariableData;
use OiLab\OiLaravelAi\Data\PromptDefinition;
use OiLab\OiLaravelAi\Facades\Prompts;
use OiLab\OiLaravelAi\Support\PromptRegistry;
// In a service provider's boot(): declare the prompt and its default template.
app(PromptRegistry::class)->define(new PromptDefinition(
key: 'desk.ticket_analyse.system',
label: 'Analyse d\'un ticket',
default: "Tu analyses les tickets de :app_name.\nTypes :\n:ticket_types",
variables: [new AiPromptVariableData('ticket_types', 'Types (code : nom)', '- BUG : Bug')],
group: 'Desk',
));
// In the agent: the team override, else the global one, else the default.
public function instructions(): string
{
return Prompts::render('desk.ticket_analyse.system', ['ticket_types' => $types], teamId: $this->teamId);
}