Skip to content

The agent engineering platform.

Add request_id field to improve request tracking and debugging (for Tongyi model) (#30110)

黑牛f0153414d56e
diff --git a/libs/community/langchain_community/llms/tongyi.py b/libs/community/langchain_community/llms/tongyi.py
index e7289955f6..ade4d502a3 100644
--- a/libs/community/langchain_community/llms/tongyi.py
+++ b/libs/community/langchain_community/llms/tongyi.py
@@ -59,6 +59,7 @@ def check_response(resp: Any) -> Any:
return resp
elif resp["status_code"] in [400, 401]:
raise ValueError(
+ f"request_id: {resp['request_id']} \n "
f"status_code: {resp['status_code']} \n "
f"code: {resp['code']} \n message: {resp['message']}"
)