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

No description shown in Iteration node #5114

Open
4 tasks done
WeepsDanky opened this issue Jun 12, 2024 · 1 comment · May be fixed by #5126
Open
4 tasks done

No description shown in Iteration node #5114

WeepsDanky opened this issue Jun 12, 2024 · 1 comment · May be fixed by #5126
Assignees
Labels
🐞 bug Something isn't working

Comments

@WeepsDanky
Copy link
Contributor

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).
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.6.10

Cloud or Self Hosted

Cloud

Steps to reproduce

image
No description shown in Iteration node.

✔️ Expected Behavior

No response

❌ Actual Behavior

No response

@dosubot dosubot bot added the 🐞 bug Something isn't working label Jun 12, 2024
@HiChen404 HiChen404 linked a pull request Jun 12, 2024 that will close this issue
8 tasks
Copy link

dosubot bot commented Jun 13, 2024

Hello @WeepsDanky! I'm here to help you with bug reports, answer your questions, and assist you as you wait for a human maintainer. Let's work together to resolve any issues you may be experiencing.

The issue with the Iteration node not displaying a description might be related to the defaultValue or the checkValid function in the nodeDefault configuration. To resolve this, ensure that the description field is properly set and handled within the Iteration node's configuration. Here is a possible modification to include a description:

const nodeDefault: NodeDefault<IterationNodeType> = {
  defaultValue: {
    start_node_id: '',
    iterator_selector: [],
    output_selector: [],
    description: '', // Add this line to include a description field
  },
  getAvailablePrevNodes(isChatMode: boolean) {
    const nodes = isChatMode
      ? ALL_CHAT_AVAILABLE_BLOCKS
      : ALL_COMPLETION_AVAILABLE_BLOCKS.filter(type => type !== BlockEnum.End)
    return nodes
  },
  getAvailableNextNodes(isChatMode: boolean) {
    const nodes = isChatMode ? ALL_CHAT_AVAILABLE_BLOCKS : ALL_COMPLETION_AVAILABLE_BLOCKS
    return nodes
  },
  checkValid(payload: IterationNodeType, t: any) {
    let errorMessages = ''

    if (!errorMessages && (!payload.iterator_selector || payload.iterator_selector.length === 0))
      errorMessages = t(`${i18nPrefix}.errorMsg.fieldRequired`, { field: t(`${i18nPrefix}.nodes.iteration.input`) })

    if (!errorMessages && (!payload.output_selector || payload.output_selector.length === 0))
      errorMessages = t(`${i18nPrefix}.errorMsg.fieldRequired`, { field: t(`${i18nPrefix}.nodes.iteration.output`) })

    return {
      isValid: !errorMessages,
      errorMessage: errorMessages,
    }
  },
}

export default nodeDefault

Ensure that the description is properly set when configuring the Iteration node in your workflow. This should help in displaying the description as expected [1].

To continue talking to Dosu, mention @dosu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants