From b27b275cdc5e33edea2123e647a1fe56fa048ebb Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Tue, 5 Nov 2024 19:11:33 -0800 Subject: [PATCH] Fix for coroutine in __repr__ Refs https://github.com/simonw/llm/issues/507#issuecomment-2458639308 --- llm/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/llm/models.py b/llm/models.py index d41b17e9..ec83b47b 100644 --- a/llm/models.py +++ b/llm/models.py @@ -387,8 +387,11 @@ def from_row(cls, db, row): return response def __repr__(self): + text = '... not yet awaited ...' + if self._done: + text = "".join(self._chunks) return "".format( - self.prompt.prompt, self.text() + self.prompt.prompt, text )