Update: 2026-07-05 17:53:37
This commit is contained in:
@@ -365,12 +365,15 @@ class SiroGeminiService {
|
|||||||
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||||
curl_close($ch);
|
curl_close($ch);
|
||||||
|
|
||||||
if ($httpCode === 200) {
|
if ($httpCode !== 200) {
|
||||||
$data = json_decode($response, true);
|
echo "\n[GEMINI API ERROR] HTTP Code: $httpCode\n";
|
||||||
$text = $data['candidates'][0]['content']['parts'][0]['text'] ?? '';
|
echo "Response: $response\n\n";
|
||||||
return trim(preg_replace('/```html|```/', '', $text));
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$data = json_decode($response, true);
|
||||||
|
$text = $data['candidates'][0]['content']['parts'][0]['text'] ?? '';
|
||||||
|
return trim(preg_replace('/```html|```/', '', $text));
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user