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

Call to undefined method ChatSession::startChat() #1

Closed
koossaayy opened this issue Feb 26, 2024 · 2 comments
Closed

Call to undefined method ChatSession::startChat() #1

koossaayy opened this issue Feb 26, 2024 · 2 comments

Comments

@koossaayy
Copy link

Hello,
First of all, thank you for this package.
I just installed it, the version 1.0.1 with PHP 8.3.1 & Laravel 10.10
and I got that error
Call to undefined method Gemini\Resources\ChatSession::startChat()

And here is the code

    $chat = Gemini::chat()->startChat(history: [
        Content::parse(part: 'The stories you write about what I have to say should be one line. Is that clear?'),
        Content::parse(part: 'Yes, I understand. The stories I write about your input should be one line long.', role: Role::MODEL),
    ]);

    $response = $chat->sendMessage('Create a story set in a quiet village in 1600s France');
    return $response->text(); // Amidst rolling hills and winding cobblestone streets, the tranquil village of Beausoleil whispered tales of love, intrigue, and the magic of everyday life in 17th century France.

I hope I didn't do something wrong, or skipped something in the docs.

@aydinfatih
Copy link
Contributor

Hello @koossaayy,

First of all, thank you for your feedback. There was something missing here and I fixed it in the PR below.
Can you try again after composer update?

google-gemini-php/client#5

@koossaayy
Copy link
Author

Works like a charm. Thank you ♥

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

2 participants