community: Fix error handling bug in ChatDeepInfra (#28918)

In the async ClientResponse, `response.text` is not a string property,
but an asynchronous function returning a string.
This commit is contained in:
Andy Wermke 2024-12-26 20:45:12 +01:00 committed by GitHub
parent d46fddface
commit 5940ed3952
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -290,7 +290,7 @@ class ChatDeepInfra(BaseChatModel):
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