Skip to content

Commit

Permalink
Merge pull request #878 from isamu/map_type_inference
Browse files Browse the repository at this point in the history
type inference
  • Loading branch information
isamu authored Jan 8, 2025
2 parents 945c0f4 + aa8dda0 commit 990e87a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions agents/vanilla_agents/src/graph_agents/map_agent.ts
Original file line number Diff line number Diff line change
@@ -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<
{
Expand Down Expand Up @@ -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];
}
});

Expand Down

0 comments on commit 990e87a

Please sign in to comment.