Skip to content

Commit

Permalink
Merge pull request #3388 from CityOfBoston/DIG-3968
Browse files Browse the repository at this point in the history
(develop) (hotfix) DIG-3968 Runtime error.
  • Loading branch information
davidrkupton authored Mar 28, 2024
2 parents 63ba42a + ea61c78 commit f1df8aa
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@ public function execute(array $parameters = []): string {
$this->response[$model_id]["usageMetadata"] = $result["usageMetadata"];
}

$this->loadSafetyRatings($result["candidates"][0]["safetyRatings"], $key, $model_id);
if (!empty($result["candidates"][0]["safetyRatings"])) {
$this->loadSafetyRatings($result["candidates"][0]["safetyRatings"], $key, $model_id);
}

if (isset($result["candidates"][0]["content"]["parts"][0]["text"])) {
$this->response[$model_id]["content"] .= $result["candidates"][0]["content"]["parts"][0]["text"];
Expand Down

0 comments on commit f1df8aa

Please sign in to comment.