Skip to content

Undefined array key "safetyRatings" #6

@netbbe

Description

@netbbe

In some cases, we're seeing the sendMessage function fail. We cannot reproduce this consistently, but it happens in roughly 2 to 5% of our calls.

Undefined array key "safetyRatings" {"exception":"[object] (ErrorException(code: 0): Undefined array key \"safetyRatings\" at /home/vagrant/code/site/admin/vendor/gemini-api-php/client/src/Resources/PromptFeedback.php:38) [stacktrace] #0 /home/vagrant/code/site/admin/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(255): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError() #1 /home/vagrant/code/site/admin/vendor/gemini-api-php/client/src/Resources/PromptFeedback.php(38): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->Illuminate\\Foundation\\Bootstrap\\{closure}() #2 /home/vagrant/code/site/admin/vendor/gemini-api-php/client/src/Responses/GenerateContentResponse.php(99): GeminiAPI\\Resources\\PromptFeedback::fromArray() #3 /home/vagrant/code/site/admin/vendor/gemini-api-php/client/src/Client.php(76): GeminiAPI\\Responses\\GenerateContentResponse::fromArray() #4 /home/vagrant/code/site/admin/vendor/gemini-api-php/client/src/GenerativeModel.php(58): GeminiAPI\\Client->generateContent() #5 /home/vagrant/code/site/admin/vendor/gemini-api-php/client/src/ChatSession.php(38): GeminiAPI\\GenerativeModel->generateContentWithContents() #6 /home/vagrant/code/site/admin/vendor/gemini-api-php/laravel/src/ChatSession.php(25): GeminiAPI\\ChatSession->sendMessage() #7 /home/vagrant/code/site/admin/app/Jobs/AISummary.php(70): GeminiAPI\\Laravel\\ChatSession->sendMessage() 

If I want to add anything useful, it is that it happens with longer chat conversations.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions