From 2f1579e5b751cc7202cba4fa08eba580dd38a87d Mon Sep 17 00:00:00 2001 From: tcmofashi Date: Thu, 6 Mar 2025 14:43:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=BA=E6=89=80=E6=9C=89=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E8=AF=B7=E6=B1=82=E6=B7=BB=E5=8A=A0=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E5=A4=B4=E5=92=8C=E8=AF=B7=E6=B1=82=E4=BD=93=E7=9A=84=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugins/models/utils_model.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/plugins/models/utils_model.py b/src/plugins/models/utils_model.py index 88fd831b8..a3dfdfa9b 100644 --- a/src/plugins/models/utils_model.py +++ b/src/plugins/models/utils_model.py @@ -83,6 +83,7 @@ class LLM_request: await asyncio.sleep(wait_time) else: logger.critical(f"请求失败: {str(e)}", exc_info=True) + logger.critical(f"请求头: {headers} 请求体: {data}") raise RuntimeError(f"API请求失败: {str(e)}") logger.error("达到最大重试次数,请求仍然失败") @@ -170,6 +171,7 @@ class LLM_request: await asyncio.sleep(wait_time) else: logger.critical(f"请求失败: {str(e)}", exc_info=True) + logger.critical(f"请求头: {headers} 请求体: {data}") raise RuntimeError(f"API请求失败: {str(e)}") logger.error("达到最大重试次数,请求仍然失败") @@ -223,6 +225,7 @@ class LLM_request: await asyncio.sleep(wait_time) else: logger.error(f"请求失败: {str(e)}") + logger.critical(f"请求头: {headers} 请求体: {data}") return f"请求失败: {str(e)}", "" logger.error("达到最大重试次数,请求仍然失败") @@ -302,6 +305,7 @@ class LLM_request: time.sleep(wait_time) else: logger.critical(f"请求失败: {str(e)}", exc_info=True) + logger.critical(f"请求头: {headers} 请求体: {data}") raise RuntimeError(f"API请求失败: {str(e)}") logger.error("达到最大重试次数,请求仍然失败") @@ -358,6 +362,7 @@ class LLM_request: time.sleep(wait_time) else: logger.critical(f"embedding请求失败: {str(e)}", exc_info=True) + logger.critical(f"请求头: {headers} 请求体: {data}") return None logger.error("达到最大重试次数,embedding请求仍然失败") @@ -414,6 +419,7 @@ class LLM_request: await asyncio.sleep(wait_time) else: logger.critical(f"embedding请求失败: {str(e)}", exc_info=True) + logger.critical(f"请求头: {headers} 请求体: {data}") return None logger.error("达到最大重试次数,embedding请求仍然失败")