PHP code example of ursamajeur / laravel-ai-gemini-driver

1. Go to this page and download the library: Download ursamajeur/laravel-ai-gemini-driver 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/ */

    

ursamajeur / laravel-ai-gemini-driver example snippets


use Laravel\Ai\Ai;

// Text generation
$provider = Ai::textProvider('cloudcode-pa');

// Reranking
$provider = Ai::rerankingProvider('cloudcode-pa');

'cascade' => [
    'enabled' => true,
    'steps' => [
        'claude-opus-4',
        'gemini-2.5-pro',
        'gemini-2.5-flash',
    ],
],
bash
php artisan vendor:publish --tag=cloudcode-pa-config