Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing a numerical value of 0 to a tool created in a workflow causes an error. #10251

Closed
5 tasks done
emadurandal opened this issue Nov 4, 2024 · 1 comment · Fixed by #10255
Closed
5 tasks done
Assignees
Labels
🐞 bug Something isn't working 🌊 feat:workflow Workflow related stuff.

Comments

@emadurandal
Copy link

Self Checks

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

Dify version

0.10.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. Create a tool with numerical value as a input in the workflow. (check the attached file "zero_test.yml" in "DSL.zip")
    image

  2. Create a new workflow and use the tool you just created at step 1. (check the attached file "zero_test2.yml" in "DSL.zip")
    image

  3. Pass the number 0 as input for that tool.

  4. The error occurs.
    image
    DSL.zip

There may be a problem with the if statement that determines the presence of arguments, I guess.

✔️ Expected Behavior

0 is passed to the tool without any problem.

❌ Actual Behavior

The following error occurs: "Failed to invoke tool: number is required in input form"

Copy link

dosubot bot commented Nov 4, 2024

Hey there, @emadurandal! I'm here to assist you with any bugs, questions, or contributions you need help with. If you have any questions or need assistance, feel free to ask.

It seems like the issue you're encountering might be related to how Dify's workflow engine differentiates between a missing input and an input explicitly set to zero. Unfortunately, I couldn't find specific information on how Dify handles this differentiation or any known issues related to passing a numerical value of zero in version 0.10.2.

However, there is a known behavior in Dify's workflow tools where the presence of arguments is validated, and missing or invalid values (such as undefined, null, or an empty string) can trigger an error message indicating that a field is required [1]. This might be causing the error you're seeing when passing zero as an input.

To address this, you might want to check the logic in the tool's input validation to ensure that zero is correctly recognized as a valid input. If the issue persists, consider reviewing the tool's configuration or updating to a newer version of Dify if available, as updates might have addressed this behavior.

To continue talking to Dosu, mention @dosu.

@dosubot dosubot bot added 🌊 feat:workflow Workflow related stuff. 🐞 bug Something isn't working labels Nov 4, 2024
@laipz8200 laipz8200 self-assigned this Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 🌊 feat:workflow Workflow related stuff.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants