PHP code example of lvlup-dev / laravel-agent-editable-prompts

1. Go to this page and download the library: Download lvlup-dev/laravel-agent-editable-prompts 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/ */

    

lvlup-dev / laravel-agent-editable-prompts example snippets


use LvlupDev\AgentEditablePrompts\Services\AgentPromptService;

// Single string: all rows for this slug, sorted by priority, joined with the configured separator
$instructions = app(AgentPromptService::class)->resolve('my-agent');

// Ordered Eloquent models (e.g. Blade::render per row in your app)
$chunks = app(AgentPromptService::class)->segments('my-agent');

$service = app(\LvlupDev\AgentEditablePrompts\Services\AgentPromptService::class);

$service->segments('my-agent'); // Collection of AgentPrompt models
$service->resolve('my-agent');  // string
bash
php artisan migrate
bash
php artisan vendor:publish --tag=agent-editable-prompts-config
bash
php artisan vendor:publish --tag=agent-prompts-vue