Browse Source

fix(tool): tool node error (#7459)

Co-authored-by: hobo.l <hobo.l@binance.com>
tags/0.7.2
luckylhb90 1 year ago
parent
commit
9a715f6b68
No account linked to committer's email address
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      api/core/workflow/nodes/tool/tool_node.py

+ 2
- 2
api/core/workflow/nodes/tool/tool_node.py View File

from os import path from os import path
from typing import Any, cast 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.callback_handler.workflow_tool_callback_handler import DifyWorkflowCallbackHandler
from core.file.file_obj import FileTransferMethod, FileType, FileVar from core.file.file_obj import FileTransferMethod, FileType, FileVar
from core.tools.entities.tool_entities import ToolInvokeMessage, ToolParameter from core.tools.entities.tool_entities import ToolInvokeMessage, ToolParameter


def _fetch_files(self, variable_pool: VariablePool) -> list[FileVar]: def _fetch_files(self, variable_pool: VariablePool) -> list[FileVar]:
variable = variable_pool.get(['sys', SystemVariableKey.FILES.value]) variable = variable_pool.get(['sys', SystemVariableKey.FILES.value])
assert isinstance(variable, ArrayAnyVariable)
assert isinstance(variable, ArrayAnyVariable | ArrayAnySegment)
return list(variable.value) if variable else [] return list(variable.value) if variable else []


def _convert_tool_messages(self, messages: list[ToolInvokeMessage]): def _convert_tool_messages(self, messages: list[ToolInvokeMessage]):

Loading…
Cancel
Save