client icon indicating copy to clipboard operation
client copied to clipboard

[Error] Undefined array key "content" in vendor/gemini-api-php/client/src/Resources/Candidate.php

Open matusstafura opened this issue 1 year ago • 0 comments

Hello,

I randomly receive an error Undefined array key "content" in vendor/gemini-api-php/client/src/Resources/Candidate.php on line 65.

response is missing content

array:3 [
  "finishReason" => "SAFETY"
  "index" => 0
  "safetyRatings" => array:4 [
    0 => array:2 [
      "category" => "HARM_CATEGORY_SEXUALLY_EXPLICIT"
      "probability" => "NEGLIGIBLE"
    ]
    1 => array:2 [
      "category" => "HARM_CATEGORY_HATE_SPEECH"
      "probability" => "NEGLIGIBLE"
    ]
    2 => array:2 [
      "category" => "HARM_CATEGORY_HARASSMENT"
      "probability" => "NEGLIGIBLE"
    ]
    3 => array:2 [
      "category" => "HARM_CATEGORY_DANGEROUS_CONTENT"
      "probability" => "MEDIUM"
    ]
  ]
]

known issue: https://github.com/google/generative-ai-docs/issues/257

matusstafura avatar Sep 19 '24 08:09 matusstafura