mirror of
https://github.com/langgenius/dify.git
synced 2026-02-09 23:20:12 -05:00
fix: refix parameter for tool
This commit is contained in:
@@ -138,12 +138,15 @@ class FunctionCallStrategy(AgentPattern):
|
||||
tool_response, tool_files, _ = yield from self._handle_tool_call(
|
||||
tool_name, tool_args, tool_call_id, messages, round_log
|
||||
)
|
||||
tool_entity = self._find_tool_by_name(tool_name)
|
||||
tool_outputs[tool_name] = tool_response
|
||||
# Track files produced by tools
|
||||
output_files.extend(tool_files)
|
||||
if tool_response == TERMINAL_OUTPUT_MESSAGE:
|
||||
function_call_state = False
|
||||
final_tool_args = tool_args
|
||||
final_tool_args = tool_entity.transform_tool_parameters_type(
|
||||
tool_args
|
||||
)
|
||||
|
||||
yield self._finish_log(
|
||||
round_log,
|
||||
|
||||
@@ -57,7 +57,7 @@ class Tool(ABC):
|
||||
tool_parameters.update(self.runtime.runtime_parameters)
|
||||
|
||||
# try parse tool parameters into the correct type
|
||||
tool_parameters = self._transform_tool_parameters_type(tool_parameters)
|
||||
tool_parameters = self.transform_tool_parameters_type(tool_parameters)
|
||||
|
||||
result = self._invoke(
|
||||
user_id=user_id,
|
||||
@@ -82,7 +82,7 @@ class Tool(ABC):
|
||||
else:
|
||||
return result
|
||||
|
||||
def _transform_tool_parameters_type(self, tool_parameters: dict[str, Any]) -> dict[str, Any]:
|
||||
def transform_tool_parameters_type(self, tool_parameters: dict[str, Any]) -> dict[str, Any]:
|
||||
"""
|
||||
Transform tool parameters type
|
||||
"""
|
||||
|
||||
@@ -1963,7 +1963,6 @@ class LLMNode(Node[LLMNodeData]):
|
||||
# Files are saved as ToolFiles with valid tool_file_id for later reference
|
||||
sandbox_output_files = session.collect_output_files()
|
||||
|
||||
|
||||
if result is None:
|
||||
raise LLMNodeError("SandboxSession exited unexpectedly")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user