fix(gemini): append empty choice to model response when there are no candidates

This commit is contained in:
Sian Cao 2025-04-21 18:40:42 +08:00
parent ebfff975d4
commit c958bbe706

View file

@ -949,6 +949,8 @@ class VertexGeminiConfig(VertexAIBaseConfig, BaseConfig):
) = self._process_candidates(
_candidates, model_response, litellm_params
)
else:
model_response.choices.append(litellm.Choices())
usage = self._calculate_usage(completion_response=completion_response)
setattr(model_response, "usage", usage)