Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

syntax error #9

Closed
ahmad-nikoo opened this issue May 7, 2024 · 8 comments
Closed

syntax error #9

ahmad-nikoo opened this issue May 7, 2024 · 8 comments

Comments

@ahmad-nikoo
Copy link

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
Copy link
Author

error

@aydinfatih
Copy link
Contributor

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

@ahmad-nikoo
Copy link
Author

yes,
error

@aydinfatih
Copy link
Contributor

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

@edymarques
Copy link

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 dddd($result->text());`
And this: try this!

@aydinfatih
Copy link
Contributor

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
Copy link

same issue any solution

@agunghrynt
Copy link

same issue any solution

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

Like $res = $result->text()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants