使用通义千问调用异常
Please confirm before submission 在提交之前,请确认
- [x] I have searched for existing issues search for existing issues, including closed ones. 我已经搜索了现有问题搜索现有问题,包括已关闭的问题。"
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服务器。使用通义千问时会报错。
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'\"}"}
这个问题的原因是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 我这个比较简单粗暴,下个版本可以考虑优化一下哈
遇到同样的问题,期待修复
使用gpt5.1-codex有类似不兼容的问题
Failed to transform agent message: req_id: 5349588f07 PluginInvokeError: {"args":{},"error_type":"Exception","message":"invocation exited without response"}