mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-21 17:45:23 -04:00
Failed to transform agent message using tongyi function calling #61
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?
Originally created by @canyangyang on GitHub (Mar 11, 2025).
Self Checks
Dify version
1.0.0
Plugin version
tongyi 0.0.9
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
Create a chatflow with agent function calling and qwen max, failed running agent node
✔️ Error log
Failed to transform agent message: PluginInvokeError: {"args":{},"error_type":"Exception","message":"read llm model failed: request failed: [tongyi] Error: PluginInvokeError: {"args":{},"error_type":"KeyError","message":"'name'"}"}
@canyangyang commented on GitHub (Mar 11, 2025):
It looks like a json convert problem. Please check the \models\llm\llm.py_convert_tools.
heres the document of qwen function calling feature
https://help.aliyun.com/zh/model-studio/user-guide/qwen-function-calling?spm=a2c4g.11186623.help-menu-search-2400256.d_0#cf2f65edde0il
@xiandan-erizo commented on GitHub (Mar 13, 2025):
same
@Thiswhyme commented on GitHub (Mar 18, 2025):
同样问题
@jiandanfeng commented on GitHub (Mar 18, 2025):
This is a question from Tongyi, and the response from the official website is as follows:
{
"status_code": 200,
"request_id": "33cf0a53-ea38-9f47-8fce-b93b55d86573",
"code": "",
"message": "",
"output": {
"text": null,
"finish_reason": null,
"choices": [
{
"finish_reason": "tool_calls",
"message": {
"role": "assistant",
"content": "",
"tool_calls": [
{
"function": {
"name": "get_current_weather",
"arguments": "{"location": "杭州市"}"
},
"index": 0,
"id": "call_9f62f52f3a834a8194f634",
"type": "function"
}
]
}
}
]
},
"usage": {
"input_tokens": 217,
"output_tokens": 18,
"total_tokens": 235
}
}
When the actual response does:When finish_reason = tool_calls, function is empty
{"status_code": 200, "request_id": "xxxx", "code": "", "message": "", "output": {"text": null, "finish_reason": null, "choices": [{"finish_reason": "null", "message": {"role": "assistant", "content": "", "tool_calls": [{"index": 0, "id": "call_46b2d6ab57224ea09b09ce", "type": "function", "function": {"name": "get_current_time", "arguments": "{}"}}]}}]}, "usage": {"input_tokens": 217, "output_tokens": 13, "total_tokens": 230, "prompt_tokens_details": {"cached_tokens": 0}}}
{"status_code": 200, "request_id": "yyyyy", "code": "", "message": "", "output": {"text": null, "finish_reason": null, "choices": [{"finish_reason": "tool_calls", "message": {"role": "assistant", "content": "", "tool_calls": [{"index": 0, "id": "", "type": "function", "function": {}}]}}]}, "usage": {"input_tokens": 217, "output_tokens": 13, "total_tokens": 230, "prompt_tokens_details": {"cached_tokens": 0}}}