Skip to content

In subsequent versions, will Dify support code nodes to output file type variables after running Python? #22638

Description

@mskbysh

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

In subsequent versions, can Dify support code nodes to output file type variables after running Python? The reason why I have such a demand is that after I use the model to generate character output variables, if I use tools in the market, such as the Markdown to Docx file tool, the outline level and title of the generated docx file are not what I want. At this time, I hope to highly customize the docx format through code nodes. However, the current mechanism of Dify: what type can be recognized by downstream nodes (such as the "Complete" node) depends entirely on what type the upstream node declares in the UI. Since the "Code" node cannot declare that it will output a "file" on the UI, the "Complete" node can never treat the variable it receives as a file, and it can never generate a download link. This results in that even if I can write Python code to complete the code execution node and highly format my document, I cannot output the document download link I want. I hope that developers can support the file output variable type support of the code execution node in subsequent versions.

2. Additional context or comments

No response

3. Can you help us with this feature?

  • I am interested in contributing to this feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions