From 96f910bb30667cac2bb2e67116a8a2a0bf294c06 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Tue, 13 May 2025 16:39:20 -0700 Subject: [PATCH] Fix for TypeError: 'coroutine' object is not iterable --- llm/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llm/models.py b/llm/models.py index a0266be..ea496ed 100644 --- a/llm/models.py +++ b/llm/models.py @@ -975,10 +975,10 @@ class AsyncResponse(_BaseResponse): await self._force() return self._tool_calls - def tool_calls_or_raise(self) -> str: + def tool_calls_or_raise(self) -> List[ToolCall]: if not self._done: raise ValueError("Response not yet awaited") - return self.tool_calls() + return self._tool_calls async def json(self) -> Optional[Dict[str, Any]]: await self._force()