Skip to content

Commit a9f1c20

Browse files
committed
fix: Do not call _append_gapic_content() on empty content
1 parent 0c498c5 commit a9f1c20

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vertexai/generative_models/_generative_models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1829,8 +1829,8 @@ def _append_gapic_candidate(
18291829
raise ValueError(
18301830
f"Incorrect candidate indexes: {base_candidate.index} != {new_candidate.index}"
18311831
)
1832-
1833-
_append_gapic_content(base_candidate.content, new_candidate.content)
1832+
if new_candidate.content:
1833+
_append_gapic_content(base_candidate.content, new_candidate.content)
18341834

18351835
# For these attributes, the last value wins
18361836
if new_candidate.finish_reason:

0 commit comments

Comments
 (0)