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

- **Description**: Added the request_id field to the check_response
function to improve request tracking and debugging, applicable for the
Tongyi model.
- **Issue**: None
- **Dependencies**: None
- **Twitter handle**: None

- **Add tests and docs**: None

- **Lint and test**: Ran `make format`, `make lint`, and `make test` to
ensure the code meets formatting and testing requirements.
This commit is contained in:
黑牛 2025-03-06 00:03:47 +08:00 committed by GitHub
parent 1ee8aceaee
commit f0153414d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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']}"
)