diff --git a/src/utils/toGraphAi.ts b/src/utils/toGraphAi.ts index 7f4a42d..8e0fd73 100644 --- a/src/utils/toGraphAi.ts +++ b/src/utils/toGraphAi.ts @@ -1,4 +1,4 @@ -import { ComputedNodeData, AgentFunctionInfo } from "graphai"; +import { NodeData, AgentFunctionInfo } from "graphai"; import { serializedLGraph, LGraphNode } from "litegraph.js"; const liteGraph2GraphData = (liteGraph: serializedLGraph, lite2agent: Record, lite2inputs: Record, lite2output: Record) => { @@ -36,13 +36,20 @@ const liteGraph2GraphData = (liteGraph: serializedLGraph, lite2agent: Record, node: ReturnType) => { + const nodes = liteGraph.nodes.reduce((tmp: Record, node: ReturnType) => { // [link index, out node, out position, in node, in position] const inputs = linkObj[node.id]; - const agent = lite2agent[node.type||'']; - tmp[`node_${node.id}`] = { - agent: agent ? agent.name : node.type || '', - inputs: inputs ? inputs : undefined, + + if ((node.type||'').startsWith("static/")) { + tmp[`node_${node.id}`] = { + value: "123", + } + } else { + const agent = lite2agent[node.type||'']; + tmp[`node_${node.id}`] = { + agent: agent ? agent.name : node.type || '', + inputs: inputs ? inputs : undefined, + } } return tmp; }, {});