fix: 修复异步请求读取错误内容的方法

This commit is contained in:
yinpeng
2024-12-25 17:37:30 +08:00
parent a059c4d586
commit 6e90463251

View File

@@ -335,7 +335,7 @@ class ChatService:
"POST", stream_url, json=payload
) as async_response:
if async_response.status_code != 200:
error_content = await async_response.read()
error_content = await async_response.aread()
error_msg = error_content.decode("utf-8")
logger.error(
f"API error: {async_response.status_code}, {error_msg}"