Skip to content

Commit

Permalink
community: Fix error handling bug in ChatDeepInfra (#28918)
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 26, 2024
1 parent d46fddf commit 5940ed3
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 5940ed3

Please sign in to comment.