Closed tarun-pixeleyez closed 4 months ago
Hello @tarun-pixeleyez,
Can you share the full error log?
Hii @aydinfatih
I just recieved Unsupported operand types: string * int error, when i run my index method.
When I try the same code, no error occurs. If you can share the trace logs here. We can catch something from these logs.
I am closing this issue as there is no reply. You can add a reply if the problem persists.
+1
use Gemini\Data\Blob;
use Gemini\Enums\MimeType;
use Gemini\Laravel\Facades\Gemini;
use Illuminate\Http\Request;
$result = Gemini::geminiProVision()
->generateContent([
'What is this picture?',
new Blob(
mimeType: MimeType::IMAGE_JPEG,
data: base64_encode(
file_get_contents('https://storage.googleapis.com/generativeai-downloads/images/scones.jpg')
)
),
]);
$result->text();
Loog says something about guzzle
[2024-05-27 00:22:41] local.ERROR: Unsupported operand types: string int {"exception":"[object] (TypeError(code: 0): Unsupported operand types: string int at /var/www/html/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:420) [stacktrace]
laravel.log Please clone my project here: https://github.com/jhoanborges/gemini-reader
Found the solution. When the following variables are empty in the .env file it crash
I commented them out and it's working. Hope it helps
I am using Laravel 10 version or Gemini 1.0 version but getting this error.