It is not very convenient to obtain parameters from the input when invoking tools in combination with business application scenarios
Self Checks
- [X] I have searched for existing issues search for existing issues, including closed ones.
- [X] I confirm that I am using English to file this report (我已阅读并同意 Language Policy).
Dify version
0.5.2
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
Can the tool invocation obtain parameters from the query instead of from the input? Or, based on the question, dynamically display a form if input parameters are required?
✔️ Expected Behavior
No response
❌ Actual Behavior
No response
🤖
Hello @andylzming, great to see you again! I hope you're having a good day. Let's dig into this issue you're facing with dify.
Thank you for your feedback and suggestion. Currently, in dify, parameters are obtained from the input when invoking tools through the validate_parameters method in the BuiltinToolProviderController class. This method takes in the tool name and a dictionary of tool parameters as arguments. You can find more details about this in the source code.
As for your suggestion about obtaining parameters from the query instead of from the input, this is not currently supported in dify. However, it's a valid suggestion and could potentially improve the flexibility of tool invocation.
Regarding your second suggestion about dynamically displaying a form based on the question, the current implementation of the ActivateForm in dify does not support this feature. The form fields are statically defined and include fields for name, password, interface language, and timezone. The form does not have a mechanism to dynamically add or remove fields based on a question. You can find more details about this in the source code.
However, it's worth noting that introducing such a feature would require significant changes to the current form implementation and might also require changes to the form validation and submission logic.
I hope this answers your questions. If you have any more questions or need further clarification, feel free to ask.
Sources
- api/core/tools/provider/builtin_tool_provider.py
- web/app/activate/activateForm.tsx
- api/controllers/console/workspace/tool_providers.py
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
If you want to continue the conversation, start your reply with @dosu-bot.
We will provide a HTTP Request component in the workflow next month, which will be more convenient.
Close due to it's no longer active, if you have any questions, you can reopen it.
We will provide a HTTP Request component in the workflow next month, which will be more convenient.
Has this feature been implemented in the new version?