From d35b95392bd7c1bfbbc2bff9c40ff22b3dd02f93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Silva?= Date: Thu, 12 Sep 2024 13:58:22 +0200 Subject: [PATCH] fix: handle google exceptions and add backoff (#154) * fix: handle google exceptions and add backoff * add backoff * fix google --- elleelleaime/evaluate/strategies/google/google.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/elleelleaime/evaluate/strategies/google/google.py b/elleelleaime/evaluate/strategies/google/google.py index 5070914d..c1ad5eaa 100644 --- a/elleelleaime/evaluate/strategies/google/google.py +++ b/elleelleaime/evaluate/strategies/google/google.py @@ -23,6 +23,9 @@ def _evaluate_impl(self, bug: Bug, sample: dict) -> Optional[List[dict]]: for generation in sample["generation"]: for candidate in generation["candidates"]: + if "content" not in candidate: + evaluation.append(None) + continue candidate_patch = candidate["content"]["parts"][0]["text"] candidate_patch = self.extract_patch_from_message(candidate_patch) evaluation.append(