Skip to content

Commit 5940ed3

Browse files
authored
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.
1 parent d46fddf commit 5940ed3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libs/community/langchain_community/chat_models/deepinfra.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ async def _completion_with_retry(**kwargs: Any) -> Any:
290290
async with request.apost(
291291
url=self._url(), data=self._body(kwargs), timeout=request_timeout
292292
) as response:
293-
self._handle_status(response.status, response.text)
293+
self._handle_status(response.status, await response.text())
294294
return await response.json()
295295
except Exception as e:
296296
print("EX", e) # noqa: T201

0 commit comments

Comments
 (0)