mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-29 22:46:27 +00:00
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:
parent
d46fddface
commit
5940ed3952
@ -290,7 +290,7 @@ class ChatDeepInfra(BaseChatModel):
|
|||||||
async with request.apost(
|
async with request.apost(
|
||||||
url=self._url(), data=self._body(kwargs), timeout=request_timeout
|
url=self._url(), data=self._body(kwargs), timeout=request_timeout
|
||||||
) as response:
|
) as response:
|
||||||
self._handle_status(response.status, response.text)
|
self._handle_status(response.status, await response.text())
|
||||||
return await response.json()
|
return await response.json()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("EX", e) # noqa: T201
|
print("EX", e) # noqa: T201
|
||||||
|
Loading…
Reference in New Issue
Block a user