From 36c4fd26c164cd5e71b80b1c7a7149f2b87c08b4 Mon Sep 17 00:00:00 2001 From: ascender1729 Date: Wed, 7 May 2025 20:32:40 +0530 Subject: [PATCH] Update multi-agent collaboration examples --- .../structs/multi_agent_collaboration_examples.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/swarms/structs/multi_agent_collaboration_examples.md b/docs/swarms/structs/multi_agent_collaboration_examples.md index 3a677242..2afd1b93 100644 --- a/docs/swarms/structs/multi_agent_collaboration_examples.md +++ b/docs/swarms/structs/multi_agent_collaboration_examples.md @@ -158,18 +158,18 @@ def sample_task(): wf = GraphWorkflow() wf.add_node(Node(id="agent1", type=NodeType.AGENT, agent=agent1)) wf.add_node(Node(id="agent2", type=NodeType.AGENT, agent=agent2)) -wf.add_node(Node(id="task1", type=NodeType.TASK, callable=sample_task)) # Task node :contentReference[oaicite:5]{index=5} +wf.add_node(Node(id="task1", type=NodeType.TASK, callable=sample_task)) # Connect agents to the task wf.add_edge(Edge(source="agent1", target="task1")) -wf.add_edge(Edge(source="agent2", target="task1")) # Defines DAG edges :contentReference[oaicite:6]{index=6} +wf.add_edge(Edge(source="agent2", target="task1")) wf.set_entry_points(["agent1", "agent2"]) -wf.set_end_points(["task1"]) # Entry/end configuration :contentReference[oaicite:7]{index=7} +wf.set_end_points(["task1"]) # Visualize and run -print(wf.visualize()) # Mermaid diagram output :contentReference[oaicite:8]{index=8} -results = wf.run() # Executes via internal topological sort :contentReference[oaicite:9]{index=9} +print(wf.visualize()) +results = wf.run() print("Execution results:", results) ```