You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$chat = Gemini::chat()
->startChat(history: [
Content::parse(part: "You have the following transcript. Hello, guys. Today,....", role: Role::USER),
Content::parse(part: 'I understand', role: Role::MODEL),
Content::parse(part: "Summarize it", role: Role::USER),
Content::parse(part: 'In this video, the speaker discusses three ways to return JSON from API controllers or routes in Laravel: 1. **Directly returning an Eloquent collection or model:** Laravel will automatically convert this to JSON. 2.....', role: Role::MODEL),
Content::parse(part: "What is the best way to send api data ? according to the transcript", role: Role::USER),
Content::parse(part: 'According to the transcript, the best way to send API data is to use Eloquent API resources....', role: Role::MODEL),
Content::parse(part: 'Thank You', role: Role::USER),
Content::parse(part: 'You\'re welcome! I\'m glad I could be of assistance.', role: Role::MODEL),
]);
$response = $chat->sendMessage('Show me an example for that ');
echo$response->text();
Update:
Commenting the last entries in the history, won't trigger that error. I guess that's something I am doing on my end, with the prompts. I will try more, and see.
$chat = Gemini::chat()
->startChat(history: [
Content::parse(part: "You have the following transcript. Hello, guys....", role: Role::USER),
Content::parse(part: 'I understand', role: Role::MODEL),
Content::parse(part: "Summarize it", role: Role::USER),
Content::parse(part: 'In this video, the speaker discusses three ways to return JSON from API controllers or routes in Laravel: 1. **Directly returning an Eloquent collection or model:*....', role: Role::MODEL),
Content::parse(part: "What is the best way to send api data ? according to the transcript", role: Role::USER),
Content::parse(part: 'According to the transcript, the best way to send API data is to use Eloquent API resources. ....', role: Role::MODEL),
// Content::parse(part: 'Thank You', role: Role::USER),// Content::parse(part: 'You\'re welcome! I\'m glad I could be of assistance.', role: Role::MODEL),
]);
$response = $chat->sendMessage('Thank you ');
echo$response->text();
The text was updated successfully, but these errors were encountered:
Hello @koossaayy,
Thanks for your feedback.
I was able to reproduce the problem locally. As far as I understand, it seems to be a general problem with gemini ai. Gemini returns the following response in some requests other than the normal api response. I am continuing to investigate the problem and will let you know when I find the most appropriate solution.
Hello,
Running the following code
Will return the mentioned error.
Here is the full error stack : https://flareapp.io/share/xmN9W6p5
Update:
Commenting the last entries in the history, won't trigger that error. I guess that's something I am doing on my end, with the prompts. I will try more, and see.
The text was updated successfully, but these errors were encountered: