Update: 2026-05-08 23:25:23
This commit is contained in:
@@ -13,6 +13,8 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
set_time_limit(90);
|
||||
|
||||
use App\Core\Database;
|
||||
use App\Core\Encryption;
|
||||
use App\Middleware\AuthMiddleware;
|
||||
@@ -237,7 +239,7 @@ function callGeminiGenerateContent(string $model, array $payload, string $apiKey
|
||||
'Content-Type: application/json',
|
||||
'x-goog-api-key: ' . $apiKey,
|
||||
],
|
||||
CURLOPT_TIMEOUT => 45,
|
||||
CURLOPT_TIMEOUT => 60,
|
||||
]);
|
||||
|
||||
$response = curl_exec($ch);
|
||||
@@ -245,6 +247,10 @@ function callGeminiGenerateContent(string $model, array $payload, string $apiKey
|
||||
$error = curl_error($ch);
|
||||
curl_close($ch);
|
||||
|
||||
if ($httpCode !== 200) {
|
||||
error_log("Gemini API Call Failed: HTTP $httpCode | Error: $error | URL: $url");
|
||||
}
|
||||
|
||||
return [
|
||||
'body' => is_string($response) ? $response : '',
|
||||
'http_code' => (int)$httpCode,
|
||||
|
||||
@@ -10,8 +10,8 @@ class DioClient {
|
||||
dio = Dio(
|
||||
BaseOptions(
|
||||
baseUrl: baseUrl,
|
||||
connectTimeout: const Duration(seconds: 15),
|
||||
receiveTimeout: const Duration(seconds: 15),
|
||||
connectTimeout: const Duration(seconds: 60),
|
||||
receiveTimeout: const Duration(seconds: 60),
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Accept': 'application/json',
|
||||
|
||||
Reference in New Issue
Block a user