Deploy: 2026-05-24 01:32:00

This commit is contained in:
Hamza-Ayed
2026-05-24 01:32:00 +03:00
parent 98129ac0ca
commit b995ac1076
2 changed files with 36 additions and 3 deletions

25
backend/test_gemini.php Normal file
View File

@@ -0,0 +1,25 @@
<?php
require __DIR__ . '/vendor/autoload.php';
// Adjust path if needed
require __DIR__ . '/app/Services/GeminiService.php';
$apiKey = getenv('GEMINI_API_KEY');
if (empty($apiKey)) {
// try to load from .env
$env = parse_ini_file(__DIR__ . '/.env');
$apiKey = $env['GEMINI_API_KEY'] ?? '';
}
if (empty($apiKey)) {
echo "NO API KEY FOUND\n";
exit;
}
echo "Testing Gemini API...\n";
$res = \App\Services\GeminiService::generateResponse($apiKey, "You are a helpful bot.", "hi");
if ($res) {
echo "SUCCESS: " . $res . "\n";
} else {
echo "FAILED.\n";
}