Fix for TypeError: 'coroutine' object is not iterable

This commit is contained in:
Simon Willison 2025-05-13 16:39:20 -07:00
parent 511892b30c
commit 96f910bb30

View file

@ -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()