Skip to content

Commit

Permalink
Fix error handling bug in ChatDeepInfra
Browse files Browse the repository at this point in the history
In the async ClientResponse, `response.text` is not a string property, but an asynchronous function returning a string.
  • Loading branch information
andywer authored Dec 24, 2024
1 parent 17f1ec8 commit e7fb682
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ async def _completion_with_retry(**kwargs: Any) -> Any:
async with request.apost(
url=self._url(), data=self._body(kwargs), timeout=request_timeout
) as response:
self._handle_status(response.status, response.text)
self._handle_status(response.status, await response.text())
return await response.json()
except Exception as e:
print("EX", e) # noqa: T201
Expand Down

0 comments on commit e7fb682

Please sign in to comment.