mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-21 17:45:23 -04:00
[PR #2208] [MERGED] Feat/add request id for tongyi error message #2324
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/langgenius/dify-official-plugins/pull/2208
Author: @scdeng
Created: 12/8/2025
Status: ✅ Merged
Merged: 12/9/2025
Merged by: @crazywoola
Base:
main← Head:feat/add-request-id-for-tongyi📝 Commits (3)
ca587a5Add request_id to the exception message when the Tongyi model fails.4878fc7Append request_id to the exception message when the Tongyi model fails.d5c3760Apply suggestion from @gemini-code-assist[bot]📊 Changes
2 files changed (+18 additions, -5 deletions)
View changed files
📝
models/tongyi/manifest.yaml(+1 -1)📝
models/tongyi/models/llm/llm.py(+17 -4)📄 Description
Summary
This PR improves error handling in
TongyiLargeLanguageModelby adding support for including an optionalrequest_idfrom the Tongyi API response in exception messages.What Changed
Enhanced
_handle_error_responserequest_idparameter to capture the unique request ID from Tongyi API responses.request_idif available, without altering the original behavior whenrequest_idis absent.Updated
_handle_generate_response(non-streaming)modelparameter when invoking_handle_error_response, resulting in error messages that only contained themessagetext without the model name or status code.modelparameter, ensuring error messages consistently include the model name, status code, and message across both streaming and non-streaming scenarios.Updated
_handle_generate_stream_response(streaming)modelandrequest_idwhen API calls fail, aligning with the enhancement in non-streaming.request_idfor correlation with server logs.Consistency Improvements
modelin error messages.request_idwhen provided.Benefits
request_idis essential for the Tongyi service team to look up the exact request and diagnose the true cause. request_id really Speeds up issue resolution by allowing maintainers and the Tongyi support team to correlate client errors directly with server-side logs for the exact failing request.request_idis not present, behavior remains unchanged.Related Issues or Context
This PR contains Changes to Non-Plugin
This PR contains Changes to Non-LLM Models Plugin
This PR contains Changes to LLM Models Plugin
Version Control (Any Changes to the Plugin Will Require Bumping the Version)
VersionField, Not in Meta Section)Dify Plugin SDK Version
dify_plugin>=0.3.0,<0.6.0is in requirements.txt (SDK docs)Environment Verification (If Any Code Changes)
Local Deployment Environment
SaaS Environment
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.