chore: apply code review comments

pull/22462/head
Novice 7 months ago
parent 9028d1e257
commit 3d70c43fd4

@ -270,15 +270,14 @@ class AgentNode(BaseNode):
)
extra = tool.get("extra", {})
node_data = cast(AgentNodeData, self._node_data)
# This is an issue that caused problems before.
# Logically, we shouldn't use the node_data.version field for judgment
# But for backward compatibility with historical data
# this version field judgment is still preserved here.
runtime_variable_pool = (
variable_pool if (node_data.version != "1" or node_data.tool_node_version != "1") else None
)
runtime_variable_pool: VariablePool | None = None
if node_data.version != "1" or node_data.tool_node_version != "1":
runtime_variable_pool = variable_pool
tool_runtime = ToolManager.get_agent_tool_runtime(
self.tenant_id, self.app_id, entity, self.invoke_from, runtime_variable_pool
)

@ -74,11 +74,9 @@ class ToolNode(BaseNode):
# Logically, we shouldn't use the node_data.version field for judgment
# But for backward compatibility with historical data
# this version field judgment is still preserved here.
variable_pool = (
self.graph_runtime_state.variable_pool
if (node_data.version != "1" or node_data.tool_node_version != "1")
else None
)
variable_pool: VariablePool | None = None
if node_data.version != "1" or node_data.tool_node_version != "1":
variable_pool = self.graph_runtime_state.variable_pool
tool_runtime = ToolManager.get_workflow_tool_runtime(
self.tenant_id, self.app_id, self.node_id, self._node_data, self.invoke_from, variable_pool
)

Loading…
Cancel
Save