mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-14 18:56:00 +08:00
fix(tool): tool node error (#7459)
Co-authored-by: hobo.l <hobo.l@binance.com>
This commit is contained in:
parent
8c32f8c77d
commit
9a715f6b68
@ -2,7 +2,7 @@ from collections.abc import Mapping, Sequence
|
|||||||
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
|
||||||
@ -142,7 +142,7 @@ class ToolNode(BaseNode):
|
|||||||
|
|
||||||
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…
x
Reference in New Issue
Block a user