Skip to content

Commit

Permalink
text_or_raise() on sync Response too
Browse files Browse the repository at this point in the history
Refs #632
  • Loading branch information
simonw committed Nov 18, 2024
1 parent 84f8363 commit 07b7349
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions llm/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,9 @@ def text(self) -> str:
self._force()
return "".join(self._chunks)

def text_or_raise(self) -> str:
return self.text()

def json(self) -> Optional[Dict[str, Any]]:
self._force()
return self.response_json
Expand Down

0 comments on commit 07b7349

Please sign in to comment.