diff --git a/src/GoogleProvider.php b/src/GoogleProvider.php index c8dd329..e1bf17b 100644 --- a/src/GoogleProvider.php +++ b/src/GoogleProvider.php @@ -730,8 +730,6 @@ protected function getRequest(string $url): array $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); $error = curl_error($ch); - curl_close($ch); - if ($error !== '') { throw new RuntimeException("Google API request failed: {$error}"); } @@ -770,8 +768,6 @@ protected function downloadVideo(string $uri): string|false $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); $error = curl_error($ch); - curl_close($ch); - if ($error !== '' || $httpCode >= 400 || !is_string($data)) { return false; } @@ -1419,8 +1415,6 @@ protected function request(string $url, array $payload): array $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); $error = curl_error($ch); - curl_close($ch); - if ($error !== '') { throw new RuntimeException("Google API request failed: {$error}"); } @@ -1468,8 +1462,6 @@ protected function embeddingRequest(array $payload, string $url): array $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); $error = curl_error($ch); - curl_close($ch); - if ($error !== '') { throw new RuntimeException("Google API request failed: {$error}"); } @@ -1556,7 +1548,6 @@ protected function streamRequest(string $url, array $payload): Generator ]); curl_exec($ch); - curl_close($ch); // Parse SSE events $lines = explode("\n", $buffer);