Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions swarms/structs/auto_swarm_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,8 @@ def create_agents(self, task: str):

agents_dictionary = model.run(task)

agents_dictionary = json.loads(agents_dictionary)

return agents_dictionary

except Exception as e:
Expand Down Expand Up @@ -437,6 +439,8 @@ def initialize_swarm_router(self, agents: List[Agent], task: str):
f"Create the swarm spec for the following task: {task}"
)

swarm_spec = json.loads(swarm_spec)

print(swarm_spec)

print(type(swarm_spec))
Expand Down
6 changes: 5 additions & 1 deletion tests/structs/test_auto_swarms_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ def test_agent_building():
agents = swarm.create_agents_from_specs(specs)
agent = agents[0]

# Create agent from spec
agents = swarm.create_agents_from_specs({"agents": [agent_spec]})
agent = agents[0]

print("✓ Built agent with configuration:")
print(f" - Name: {agent.agent_name}")
print(f" - Description: {agent.agent_description}")
Expand Down Expand Up @@ -116,7 +120,7 @@ def test_swarm_routing():
task = "Analyze the impact of AI on healthcare"

print("Starting task routing...")
result = swarm.swarm_router(agents, task)
result = swarm.initialize_swarm_router(agents, task)

print("✓ Task routed successfully")
print(
Expand Down
Loading