Skip to content

Commit

Permalink
chore: GenAI - Improved error message when accessing `GenerationRespo…
Browse files Browse the repository at this point in the history
…nse.text`

PiperOrigin-RevId: 590580220
  • Loading branch information
Ark-kun authored and copybara-github committed Dec 13, 2023
1 parent 28925e9 commit b647ef9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vertexai/generative_models/_generative_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1306,7 +1306,7 @@ def candidates(self) -> List["Candidate"]:
def text(self) -> str:
if len(self.candidates) > 1:
raise ValueError("Multiple candidates are not supported")
return self.candidates[0].content.parts[0].text
return self.candidates[0].text


class Candidate:
Expand Down

0 comments on commit b647ef9

Please sign in to comment.