Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

feat: support to upload files for visual model call when running LLM node for debugging in a single step (#23521)

goofy4da6ec787e8b
diff --git a/api/core/workflow/nodes/llm/node.py b/api/core/workflow/nodes/llm/node.py
index dfc2a0000b3..c0c0cb405ce 100644
--- a/api/core/workflow/nodes/llm/node.py
+++ b/api/core/workflow/nodes/llm/node.py
@@ -5,7 +5,7 @@ import logging
from collections.abc import Generator, Mapping, Sequence
from typing import TYPE_CHECKING, Any, Optional
-from core.app.entities.app_invoke_entities import ModelConfigWithCredentialsEntity
+from core.app.entities.app_invoke_entities import InvokeFrom, ModelConfigWithCredentialsEntity
from core.file import FileType, file_manager
from core.helper.code_executor import CodeExecutor, CodeLanguage
from core.llm_generator.output_parser.errors import OutputParserError
@@ -194,6 +194,17 @@ class LLMNode(BaseNode):
else []
)
+ # single step run fetch file from sys files
+ if not files and self.invoke_from == InvokeFrom.DEBUGGER and not self.previous_node_id:
+ files = (
+ llm_utils.fetch_files(
+ variable_pool=variable_pool,
+ selector=["sys", "files"],
+ )
+ if self._node_data.vision.enabled
+ else []
+ )
+
if files:
node_inputs["#files#"] = [file.to_dict() for file in files]