PHP code example of mydnic / volet-chatbot

1. Go to this page and download the library: Download mydnic/volet-chatbot 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/ */

    

mydnic / volet-chatbot example snippets


'provider' => env('VOLET_CHATBOT_PROVIDER', 'openai'),
'model' => env('VOLET_CHATBOT_MODEL', 'gpt-4o-mini'),
'system_prompt' => env('VOLET_CHATBOT_SYSTEM_PROMPT', 'You are a helpful assistant.'),

use Mydnic\VoletChatbot\VoletChatbot;

$volet->register(
    (new VoletChatbot)
        ->setLabel('Chat with us')
);

namespace App\Ai\Agents;

use Laravel\Ai\Contracts\HasTools;
use Mydnic\VoletChatbot\Agents\ChatbotAgent;

class SupportAgent extends ChatbotAgent implements HasTools
{
    public function tools(): array
    {
        return [
            new \App\Ai\Tools\LookupOrderStatus,
        ];
    }
}

// config/volet-chatbot.php
'agent' => \App\Ai\Agents\SupportAgent::class,
bash
php artisan vendor:publish --provider="Laravel\Ai\AiServiceProvider"
php artisan migrate
bash
php artisan vendor:publish --tag="volet-assets" --force
php artisan vendor:publish --tag="volet-chatbot-config"