google-gemini-php / laravel

⚡️ Gemini PHP for Laravel is a community-maintained PHP API client that allows you to interact with the Gemini AI API.
MIT License
251 stars 29 forks source link

syntax error #9

Open ahmad-nikoo opened 2 months ago

ahmad-nikoo commented 2 months ago

hi when i use this code :

$result = Gemini::geminiPro()->generateContent("hello");
        $result->text();

i get this error : syntax error in line $result = Gemini::geminiPro()->generateContent("hello"); anybody can help me? thank's

ahmad-nikoo commented 2 months ago

error

aydinfatih commented 2 months ago

Hi @ahmad-nikoo , Can you expand the 3 vendor frames field and send the top record in that field?

ahmad-nikoo commented 2 months ago

yes, error

aydinfatih commented 2 months ago

@ahmad-nikoo I could not reproduce this problem. Can you go into the source code and see the response returned from the server?

edymarques commented 1 month ago

Good afternoon, how are you? I believe your issue is that you need to create a variable to receive the text. `$result = Gemini::geminiPro()->generateContent('Hello');

$result = $result->text(); dd($result); And that: or execute it directly on dd dd($result->text());` And this: try this!

aydinfatih commented 1 month ago

When I try this, I can get a response successfully. Here the gemini api returns in a format other than json format. Therefore I need what is returned from the gemini api.

RaminBgrn commented 2 weeks ago

same issue any solution

agunghrynt commented 1 week ago

same issue any solution

Add variable for '$result->text()'

Like $res = $result->text()