From 6a2a29aa07b8ce31b8fae3c76a4b905022d0c89c Mon Sep 17 00:00:00 2001 From: isamu Date: Wed, 8 Jan 2025 09:01:18 +0900 Subject: [PATCH 1/2] type inference --- agents/vanilla_agents/src/graph_agents/map_agent.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agents/vanilla_agents/src/graph_agents/map_agent.ts b/agents/vanilla_agents/src/graph_agents/map_agent.ts index 703782a5..318c529b 100644 --- a/agents/vanilla_agents/src/graph_agents/map_agent.ts +++ b/agents/vanilla_agents/src/graph_agents/map_agent.ts @@ -39,9 +39,9 @@ export const mapAgent: AgentFunction< if (nestedGraphData.nodes[mappedNodeId] === undefined) { // If the input node does not exist, automatically create a static node nestedGraphData.nodes[mappedNodeId] = { value: namedInputs[nodeId] }; - } else { + } else if (!("agent" in nestedGraphData.nodes[mappedNodeId])){ // Otherwise, inject the proper data here (instead of calling injectTo method later) - (nestedGraphData.nodes[mappedNodeId] as StaticNodeData)["value"] = namedInputs[nodeId]; + nestedGraphData.nodes[mappedNodeId]["value"] = namedInputs[nodeId]; } }); From aa8dda0a4d8846278d2ed8af8ef4896426e9e8f0 Mon Sep 17 00:00:00 2001 From: isamu Date: Wed, 8 Jan 2025 09:07:39 +0900 Subject: [PATCH 2/2] fix lint error --- agents/vanilla_agents/src/graph_agents/map_agent.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agents/vanilla_agents/src/graph_agents/map_agent.ts b/agents/vanilla_agents/src/graph_agents/map_agent.ts index 318c529b..d36a9294 100644 --- a/agents/vanilla_agents/src/graph_agents/map_agent.ts +++ b/agents/vanilla_agents/src/graph_agents/map_agent.ts @@ -1,4 +1,4 @@ -import { GraphAI, AgentFunction, AgentFunctionInfo, StaticNodeData, assert, graphDataLatestVersion } from "graphai"; +import { GraphAI, AgentFunction, AgentFunctionInfo, assert, graphDataLatestVersion } from "graphai"; export const mapAgent: AgentFunction< {