dify icon indicating copy to clipboard operation
dify copied to clipboard

tool parameter instruction not found in tool config

Open shatang123 opened this issue 9 months ago • 6 comments

Self Checks

  • [x] This is only for bug report, if you would like to ask a question, please head to Discussions.
  • [x] I have searched for existing issues search for existing issues, including closed ones.
  • [x] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • [x] Please do not modify this template :) and fill in all the required fields.

Dify version

1.0.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

An error occurred using the default code parser tool call Image

✔️ Expected Behavior

No response

❌ Actual Behavior

No response

shatang123 avatar Mar 11 '25 06:03 shatang123

To resolve the issue of a missing tool parameter instruction in the tool config when using the default code parser tool with the "FunctionCalling" strategy and "qwen-max" model in a self-hosted Docker environment, ensure that the tool parameter is correctly initialized and provided in the configuration. Here's what you can do:

  1. Check Tool Configuration: Make sure that all required parameters for the code parser tool are specified in the tool configuration. The required parameters are:

    • language: Must be specified as "python3" or "javascript".
    • code: The code to be executed, ensuring it only uses native packages and avoids network/IO operations [1].
  2. Initialization Function: The function init_frontend_parameter checks if the parameter value is provided. If not, it uses a default value. If the parameter is required and no value is found, it raises a ValueError. Ensure that:

    • The tool parameter is specified in the tool configuration.
    • If the parameter is required, it must be present; otherwise, ensure a default value is set in the rule.default [2].
  3. Runtime Parameters: Ensure that runtime parameters are correctly defined in the tool's implementation. For example, in the VectorizerTool class, the get_runtime_parameters method defines required parameters. Make sure your tool's parameters are similarly defined and included in the configuration [3].

By following these steps, you should be able to resolve the missing tool parameter issue in your configuration.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

dosubot[bot] avatar Mar 11 '25 06:03 dosubot[bot]

To resolve the issue of a missing tool parameter instruction in the tool config when using the default code parser tool with the "FunctionCalling" strategy and "qwen-max" model in a self-hosted Docker environment, ensure that the tool parameter is correctly initialized and provided in the configuration. Here's what you can do:解决在使用默认代码解析工具的“FunctionCalling”策略和“qwen-max”模型以及自托管 Docker 环境中,工具配置中缺少工具参数指令的问题,请确保工具参数在配置中正确初始化并提供。以下是您可以采取的操作:

  1. Check Tool Configuration: Make sure that all required parameters for the code parser tool are specified in the tool configuration. The required parameters are:检查工具配置:请确保在工具配置中指定了代码解析工具所需的所有参数。所需参数包括:

    • language: Must be specified as "python3" or "javascript".必须指定为“python3”或“javascript”。
    • code: The code to be executed, ensuring it only uses native packages and avoids network/IO operations [1].执行代码,确保它仅使用本地包并避免网络/IO 操作
  2. Initialization Function: The function init_frontend_parameter checks if the parameter value is provided. If not, it uses a default value. If the parameter is required and no value is found, it raises a ValueError. Ensure that:初始化函数:函数 init_frontend_parameter 检查是否提供了参数值。如果没有提供,则使用默认值。如果参数是必需的且未找到值,则引发 ValueError 。确保:

    • The tool parameter is specified in the tool configuration.工具参数在工具配置中指定。
    • If the parameter is required, it must be present; otherwise, ensure a default value is set in the rule.default [2].如果参数是必需的,则必须存在;否则,请确保在 rule.default [2] 中设置默认值。
  3. Runtime Parameters: Ensure that runtime parameters are correctly defined in the tool's implementation. For example, in the VectorizerTool class, the get_runtime_parameters method defines required parameters. Make sure your tool's parameters are similarly defined and included in the configuration [3].运行参数:确保在工具实现中正确定义运行参数。例如,在 VectorizerTool 类中, get_runtime_parameters 方法定义了必需的参数。请确保您的工具参数以类似方式定义并包含在配置 [3] 中。

By following these steps, you should be able to resolve the missing tool parameter issue in your configuration.按照这些步骤操作,你应该能够解决配置中缺少工具参数的问题。

To continue talking to Dosu, mention @dosu.继续与 Dosu 交谈,请提及。

Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

这个工具是dify官方提供的,工具有参数描述和是否自动生成的开关 Image

shatang123 avatar Mar 11 '25 06:03 shatang123

I have the same question, if I build an agent directly, this agent can use all tools whether the tools are original or I build. However, when I tried to create an agent in the workflow, it always showed the same problem as yours

ValentWang avatar Mar 15 '25 02:03 ValentWang

Me too

lmz2423 avatar Mar 18 '25 10:03 lmz2423

Image

I also encountered this issue at the beginning. After filling in the instructions and queries separately, I can now add and run an Agent in Chatflow without problems. Version 1.1.3

Iceblue76ec avatar Mar 27 '25 02:03 Iceblue76ec

Have you added any custom tools? Could you provide a prototype of an interface function (without content) and the tool definition in JSON format?

@Iceblue76ec

rennner avatar Mar 27 '25 05:03 rennner

I'm having the same issue. I'm using Dify 1.1.3 with docker and I'm getting an error when using the Agent.

Log

2025-04-09T18:34:07+09:00 Traceback (most recent call last):
2025-04-09T18:34:07+09:00   File "/app/api/core/workflow/graph_engine/graph_engine.py", line 645, in _run_node
2025-04-09T18:34:07+09:00     for item in generator:
2025-04-09T18:34:07+09:00                 ^^^^^^^^^
2025-04-09T18:34:07+09:00   File "/app/api/core/workflow/nodes/base/node.py", line 84, in run
2025-04-09T18:34:07+09:00     yield from result
2025-04-09T18:34:07+09:00   File "/app/api/core/workflow/nodes/agent/agent_node.py", line 94, in _run
2025-04-09T18:34:07+09:00     yield from self._transform_message(
2025-04-09T18:34:07+09:00   File "/app/api/core/workflow/nodes/tool/tool_node.py", line 208, in _transform_message
2025-04-09T18:34:07+09:00     for message in message_stream:
2025-04-09T18:34:07+09:00                    ^^^^^^^^^^^^^^
2025-04-09T18:34:07+09:00   File "/app/api/core/tools/utils/message_transformer.py", line 25, in transform_tool_invoke_messages
2025-04-09T18:34:07+09:00     for message in messages:
2025-04-09T18:34:07+09:00                    ^^^^^^^^
2025-04-09T18:34:07+09:00   File "/app/api/core/agent/strategy/base.py", line 25, in invoke
2025-04-09T18:34:07+09:00     yield from self._invoke(params, user_id, conversation_id, app_id, message_id)
2025-04-09T18:34:07+09:00   File "/app/api/core/agent/strategy/plugin.py", line 47, in _invoke
2025-04-09T18:34:07+09:00     initialized_params = self.initialize_parameters(params)
2025-04-09T18:34:07+09:00                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-09T18:34:07+09:00   File "/app/api/core/agent/strategy/plugin.py", line 31, in initialize_parameters
2025-04-09T18:34:07+09:00     params[parameter.name] = parameter.init_frontend_parameter(params.get(parameter.name))
2025-04-09T18:34:07+09:00                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-09T18:34:07+09:00   File "/app/api/core/agent/plugin_entities.py", line 57, in init_frontend_parameter
2025-04-09T18:34:07+09:00     return init_frontend_parameter(self, self.type, value)
2025-04-09T18:34:07+09:00            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-04-09T18:34:07+09:00   File "/app/api/core/plugin/entities/parameters.py", line 154, in init_frontend_parameter
2025-04-09T18:34:07+09:00     raise ValueError(f"tool parameter {rule.name} not found in tool config")
2025-04-09T18:34:07+09:00 ValueError: tool parameter instruction not found in tool config
2025-04-09T18:41:22+09:00 2025-04-09 09:41:22,364.364 INFO [Dummy-337] [_client.py:1038] - HTTP Request: GET https://marketplace.dify.ai/api/v1/plugins/download?unique_identifier=langgenius/agent:0.0.12@6b1af1fc9a716f494ff669f64c6dd4d2ae29fb5f60c15919df3f2dac89c700da "HTTP/1.1 200 OK"

I am getting this error even though I am not using a custom tool and am using the Currenttime tool with the default Agent in the Market.

How do I solve this?

Image

kokimsh avatar Apr 09 '25 10:04 kokimsh

why is this case closed?

zizhec avatar Nov 05 '25 08:11 zizhec