AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
feat(autogpt_builder) Hook up execution progress animation to live execution data (#7347)
Aarushi7ce0c655d02f
diff --git a/rnd/autogpt_builder/src/components/Flow.tsx b/rnd/autogpt_builder/src/components/Flow.tsxindex f8c9b427a6..7c354fe4d0 100644--- a/rnd/autogpt_builder/src/components/Flow.tsx+++ b/rnd/autogpt_builder/src/components/Flow.tsx@@ -260,9 +260,10 @@ const FlowEditor: React.FC<{ flowID?: string }> = ({ flowID }) => {const runAgent = async () => {try {console.log("All nodes before formatting:", nodes);+ const blockIdToNodeIdMap = {};const formattedNodes = nodes.map(node => {- console.log("Formatting node:", node.id, node.data.blockType);+ blockIdToNodeIdMap[node.data.block_id] = node.id;const inputDefault = prepareNodeInputData(node, nodes, edges);const inputNodes = edges.filter(edge => edge.target === node.id)@@ -308,6 +309,18 @@ const FlowEditor: React.FC<{ flowID?: string }> = ({ flowID }) => {setAgentId(newAgentId);console.log('Response from the API:', JSON.stringify(createData, null, 2));+ // Update the node IDs in the frontend+ const updatedNodes = createData.nodes.map(backendNode => {+ const frontendNodeId = blockIdToNodeIdMap[backendNode.block_id];+ return {+ ...nodes.find(node => node.id === frontendNodeId),+ id: backendNode.id,+ position: backendNode.metadata.position,+ };+ });++ setNodes(updatedNodes);+const executeData = await api.executeFlow(newAgentId);const runId = executeData.id;