dify-plugin-agent-mcp_sse icon indicating copy to clipboard operation
dify-plugin-agent-mcp_sse copied to clipboard

使用通义千问调用异常

Open fjcondy opened this issue 10 months ago • 2 comments

Please confirm before submission 在提交之前,请确认

Dify version Dify版本

1.3.1

Plugin version 插件版本

0.1.7

Function Calling or ReAct

Function Calling

HTTP with SSE or Streamable HTTP

HTTP with SSE

LLM Model LLM模型

qwen-max-lastest

Problem description 问题描述

调用本地的mcp服务器。使用通义千问时会报错。

Image

Image

Failed to transform agent message: PluginInvokeError: {"args":{},"error_type":"Exception","message":"read llm model failed: request failed: [tongyi] Error: PluginInvokeError: {\"args\":{\"description\":\"[models] Error: 'description'\"},\"error_type\":\"InvokeError\",\"message\":\"[models] Error: 'description'\"}"}

fjcondy avatar May 22 '25 12:05 fjcondy

这个问题的原因是dify传递给大模型的参数需要有description字段,哪怕是空字符串,你会发现官方的工具是可以成功调用的。 可以修改strategies\function_calling.py _init_prompt_mcp_tools方法,遍历parameters for tool in mcp_tools: parameters = tool.get("inputSchema") for key, value in parameters['properties'].items(): # 只有在 description 不存在时才设置为空字符串 if 'description' not in value: value['description'] = "" @junjiem 我这个比较简单粗暴,下个版本可以考虑优化一下哈

Run-Youngman avatar Aug 27 '25 02:08 Run-Youngman

遇到同样的问题,期待修复

使用gpt5.1-codex有类似不兼容的问题 Failed to transform agent message: req_id: 5349588f07 PluginInvokeError: {"args":{},"error_type":"Exception","message":"invocation exited without response"}

fightZy avatar Nov 18 '25 08:11 fightZy