PHP code example of mgahed / ai

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

    

mgahed / ai example snippets


return [
	// gemini api key
	'gemini' => [
		'api_key' => env('GEMINI_API_KEY'),
	],
];

use Mgahed\ai\Http\Helpers\GeminiModel;

## Gemini pro model
$aiResponse = GeminiModel::proModel('What is the release date of first version of php?');

## Gemini 1.5 model
$aiResponse = GeminiModel::onePointFiveModel('What is the release date of first version of php?');

## Gemini any other model
$aiResponse = GeminiModel::generalModel('What is the release date of first version of php?', 'gemini-pro');

php artisan vendor:publish --tag=mgahed-ai-config