Skip to content

Undefined array key "content" #7

@netbbe

Description

@netbbe

Similar to our Undefined array key "safetyRatings" issue, we see some calls to the sendMessage function fail. Again, we cannot reproduce this consistently, but it happens in roughly 10% of our calls. A bit more than the safetyRatings issue. And this seems to be more random.

[2024-01-02 14:50:57] local.ERROR: Undefined array key "content" {"exception":"[object] (ErrorException(code: 0): Undefined array key \"content\" at /home/vagrant/code/site/admin/vendor/gemini-api-php/client/src/Resources/Candidate.php:65)
[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/Candidate.php(65): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->Illuminate\\Foundation\\Bootstrap\\{closure}()
#2 /home/vagrant/code/site/admin/vendor/gemini-api-php/client/src/Responses/GenerateContentResponse.php(95): GeminiAPI\\Resources\\Candidate::fromArray()
#3 [internal function]: GeminiAPI\\Responses\\GenerateContentResponse::GeminiAPI\\Responses\\{closure}()
#4 /home/vagrant/code/site/admin/vendor/gemini-api-php/client/src/Responses/GenerateContentResponse.php(94): array_map()
#5 /home/vagrant/code/site/admin/vendor/gemini-api-php/client/src/Client.php(76): GeminiAPI\\Responses\\GenerateContentResponse::fromArray()
#6 /home/vagrant/code/site/admin/vendor/gemini-api-php/client/src/GenerativeModel.php(58): GeminiAPI\\Client->generateContent()
#7 /home/vagrant/code/site/admin/vendor/gemini-api-php/client/src/ChatSession.php(38): GeminiAPI\\GenerativeModel->generateContentWithContents()
#8 /home/vagrant/code/site/admin/vendor/gemini-api-php/laravel/src/ChatSession.php(25): GeminiAPI\\ChatSession->sendMessage()
#9 /home/vagrant/code/site/admin/app/Jobs/AISummary.php(168): GeminiAPI\\Laravel\\ChatSession->sendMessage()

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