Closed BellMeng closed 5 months ago
To address the issue with the "sys.files" variable not being accessible in intermediate nodes of your Dify workflow, it's important to understand that this behavior might be due to the sandboxed execution environment of Dify, which restricts certain functionalities for security reasons. However, there's a workaround that involves using the getNodeOutputVars
function to access "sys.files" in intermediate nodes.
You can adapt your workflow to ensure that "sys.files" is included in the output variables of intermediate nodes by implementing custom logic within your workflow processing or node handling. This might involve modifying node output structures or ensuring that variables are passed along between nodes as needed.
Here's a code snippet that demonstrates how "sys.files" is added to the output variables for a start node, which can be adapted for your needs:
case BlockEnum.Start: {
const {
variables,
} = data as StartNodeType
res = variables.map((v) => {
return [id, v.variable]
})
if (isChatMode) {
res.push([id, 'sys', 'query'])
res.push([id, 'sys', 'files'])
}
break
}
For further guidance on implementing this workaround, you might want to review the documentation and code examples provided in Dify's official resources. This approach will help you ensure that "sys.files" or any other necessary system variables are accessible throughout your workflow as needed.
To continue the conversation, mention @dosu.
Now sys.files can be only used in LLM node for vision model.
I want to read or modify files passed to llm during workflow process. Is there planned support?
Now sys.files can be only used in LLM node for vision model.
I have used the LLM vision model, but it seems no sys.files appear in options.
Hello, I also encountered the same problem, I want to reference the sys.files variable in other nodes, but I can't get it, including llm (gpt4o with Visual recognition), is there another way to help me?
My scenario is that I need to feed the text input to the llm output text as the input to the knowledge base
Self Checks
Dify version
0.6.8
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
✔️ Expected Behavior
The variable "sys.files" can be used in overall workflow node.
❌ Actual Behavior
The variable "sys.files" only can be used in start and end node.