removed mentions of linear swarm

pull/1245/head
Hugh 2 days ago
parent 7012784c91
commit 15a8349fbb

@ -24393,7 +24393,6 @@ from swarms.structs.swarming_architectures import (
exponential_swarm, exponential_swarm,
fibonacci_swarm, fibonacci_swarm,
grid_swarm, grid_swarm,
linear_swarm,
mesh_swarm, mesh_swarm,
one_to_three, one_to_three,
prime_swarm, prime_swarm,
@ -24634,7 +24633,6 @@ async def run_all_examples():
# Finance examples # Finance examples
run_finance_circular_swarm() run_finance_circular_swarm()
run_finance_linear_swarm()
run_finance_mesh_swarm() run_finance_mesh_swarm()
run_mathematical_finance_swarms() run_mathematical_finance_swarms()

@ -324,7 +324,6 @@ from swarms.structs.swarming_architectures import (
exponential_swarm, exponential_swarm,
fibonacci_swarm, fibonacci_swarm,
grid_swarm, grid_swarm,
linear_swarm,
mesh_swarm, mesh_swarm,
one_to_three, one_to_three,
prime_swarm, prime_swarm,
@ -565,7 +564,6 @@ async def run_all_examples():
# Finance examples # Finance examples
run_finance_circular_swarm() run_finance_circular_swarm()
run_finance_linear_swarm()
run_finance_mesh_swarm() run_finance_mesh_swarm()
run_mathematical_finance_swarms() run_mathematical_finance_swarms()

@ -8,7 +8,6 @@ from swarms.structs.swarming_architectures import (
exponential_swarm, exponential_swarm,
fibonacci_swarm, fibonacci_swarm,
grid_swarm, grid_swarm,
linear_swarm,
mesh_swarm, mesh_swarm,
one_to_three, one_to_three,
prime_swarm, prime_swarm,
@ -263,7 +262,6 @@ async def run_all_examples():
# Finance examples # Finance examples
run_finance_circular_swarm() run_finance_circular_swarm()
run_finance_linear_swarm()
run_finance_mesh_swarm() run_finance_mesh_swarm()
run_mathematical_finance_swarms() run_mathematical_finance_swarms()

@ -90,7 +90,6 @@ from swarms.structs.swarming_architectures import (
geometric_swarm, geometric_swarm,
grid_swarm, grid_swarm,
harmonic_swarm, harmonic_swarm,
linear_swarm,
log_swarm, log_swarm,
mesh_swarm, mesh_swarm,
one_to_one, one_to_one,
@ -128,7 +127,6 @@ __all__ = [
"geometric_swarm", "geometric_swarm",
"grid_swarm", "grid_swarm",
"harmonic_swarm", "harmonic_swarm",
"linear_swarm",
"log_swarm", "log_swarm",
"mesh_swarm", "mesh_swarm",
"one_to_one", "one_to_one",

@ -119,60 +119,6 @@ class CircularSwarm(BaseSwarm):
return self._format_return() return self._format_return()
class LinearSwarm(BaseSwarm):
"""
Implements a linear swarm where agents process tasks sequentially.
"""
def __init__(
self,
agents: AgentListType,
name: str = "LinearSwarm",
description: str = "A linear swarm where agents process tasks sequentially",
output_type: str = "dict",
):
"""
Initialize the LinearSwarm.
Args:
agents: List of Agent objects or nested list of Agent objects
name: Name of the swarm
description: Description of the swarm's purpose
output_type: Type of output format, one of 'dict', 'list', 'string', 'json', 'yaml', 'xml', etc.
"""
super().__init__(agents, name, description, output_type)
def run(self, tasks: List[str]) -> Union[Dict, List, str]:
"""
Run the linear swarm with the given tasks
Args:
tasks: List of tasks to be processed
Returns:
Union[Dict, List, str]: The conversation history in the requested format
"""
if not self.agents or not tasks:
raise ValueError(
"Agents and tasks lists cannot be empty."
)
tasks_copy = tasks.copy()
responses = []
for agent in self.agents:
if tasks_copy:
task = tasks_copy.pop(0)
response = agent.run(task)
self.conversation.add(
role=agent.agent_name,
content=response,
)
responses.append(response)
return self._format_return()
class StarSwarm(BaseSwarm): class StarSwarm(BaseSwarm):
""" """
Implements a star swarm where a central agent processes all tasks, followed by others. Implements a star swarm where a central agent processes all tasks, followed by others.

@ -8,7 +8,6 @@ from swarms.structs.swarming_architectures import (
geometric_swarm, geometric_swarm,
grid_swarm, grid_swarm,
harmonic_swarm, harmonic_swarm,
linear_swarm,
log_swarm, log_swarm,
mesh_swarm, mesh_swarm,
one_to_one, one_to_one,
@ -69,21 +68,6 @@ def test_grid_swarm():
assert len(result) > 0 assert len(result) > 0
def test_linear_swarm():
"""Test linear swarm sequential processing"""
agents = create_test_agents(3)
tasks = ["Research task", "Write content", "Review output"]
result = linear_swarm(agents, tasks)
assert isinstance(result, list)
assert len(result) > 0
for log in result:
assert "role" in log
assert "content" in log
def test_star_swarm(): def test_star_swarm():
"""Test star swarm with central and peripheral agents""" """Test star swarm with central and peripheral agents"""
agents = create_test_agents(4) agents = create_test_agents(4)

Loading…
Cancel
Save