|
|
|
@@ -2,7 +2,7 @@ from collections.abc import Mapping, Sequence |
|
|
|
from os import path |
|
|
|
from typing import Any, cast |
|
|
|
|
|
|
|
from core.app.segments import ArrayAnyVariable, parser |
|
|
|
from core.app.segments import ArrayAnySegment, ArrayAnyVariable, parser |
|
|
|
from core.callback_handler.workflow_tool_callback_handler import DifyWorkflowCallbackHandler |
|
|
|
from core.file.file_obj import FileTransferMethod, FileType, FileVar |
|
|
|
from core.tools.entities.tool_entities import ToolInvokeMessage, ToolParameter |
|
|
|
@@ -142,7 +142,7 @@ class ToolNode(BaseNode): |
|
|
|
|
|
|
|
def _fetch_files(self, variable_pool: VariablePool) -> list[FileVar]: |
|
|
|
variable = variable_pool.get(['sys', SystemVariableKey.FILES.value]) |
|
|
|
assert isinstance(variable, ArrayAnyVariable) |
|
|
|
assert isinstance(variable, ArrayAnyVariable | ArrayAnySegment) |
|
|
|
return list(variable.value) if variable else [] |
|
|
|
|
|
|
|
def _convert_tool_messages(self, messages: list[ToolInvokeMessage]): |