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 17, 2024
1 parent 7382301 commit 0fec974
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 @@ -316,6 +316,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 0fec974

Please sign in to comment.