diff --git a/docs/llm.txt b/docs/llm.txt index c6a7e85e..d6674264 100644 --- a/docs/llm.txt +++ b/docs/llm.txt @@ -24393,7 +24393,6 @@ from swarms.structs.swarming_architectures import ( exponential_swarm, fibonacci_swarm, grid_swarm, - linear_swarm, mesh_swarm, one_to_three, prime_swarm, @@ -24634,7 +24633,6 @@ async def run_all_examples(): # Finance examples run_finance_circular_swarm() - run_finance_linear_swarm() run_finance_mesh_swarm() run_mathematical_finance_swarms() diff --git a/docs/swarms/examples/unique_swarms.md b/docs/swarms/examples/unique_swarms.md index 245653af..af3b30e1 100644 --- a/docs/swarms/examples/unique_swarms.md +++ b/docs/swarms/examples/unique_swarms.md @@ -324,7 +324,6 @@ from swarms.structs.swarming_architectures import ( exponential_swarm, fibonacci_swarm, grid_swarm, - linear_swarm, mesh_swarm, one_to_three, prime_swarm, @@ -565,7 +564,6 @@ async def run_all_examples(): # Finance examples run_finance_circular_swarm() - run_finance_linear_swarm() run_finance_mesh_swarm() run_mathematical_finance_swarms() diff --git a/examples/multi_agent/utils/unique_swarms_examples.py b/examples/multi_agent/utils/unique_swarms_examples.py index 6c315e25..09788cbf 100644 --- a/examples/multi_agent/utils/unique_swarms_examples.py +++ b/examples/multi_agent/utils/unique_swarms_examples.py @@ -8,7 +8,6 @@ from swarms.structs.swarming_architectures import ( exponential_swarm, fibonacci_swarm, grid_swarm, - linear_swarm, mesh_swarm, one_to_three, prime_swarm, @@ -263,7 +262,6 @@ async def run_all_examples(): # Finance examples run_finance_circular_swarm() - run_finance_linear_swarm() run_finance_mesh_swarm() run_mathematical_finance_swarms() diff --git a/swarms/structs/__init__.py b/swarms/structs/__init__.py index ec292632..18f46c5c 100644 --- a/swarms/structs/__init__.py +++ b/swarms/structs/__init__.py @@ -90,7 +90,6 @@ from swarms.structs.swarming_architectures import ( geometric_swarm, grid_swarm, harmonic_swarm, - linear_swarm, log_swarm, mesh_swarm, one_to_one, @@ -128,7 +127,6 @@ __all__ = [ "geometric_swarm", "grid_swarm", "harmonic_swarm", - "linear_swarm", "log_swarm", "mesh_swarm", "one_to_one", diff --git a/swarms/structs/various_alt_swarms.py b/swarms/structs/various_alt_swarms.py index c4b34f9f..589e9ad2 100644 --- a/swarms/structs/various_alt_swarms.py +++ b/swarms/structs/various_alt_swarms.py @@ -119,60 +119,6 @@ class CircularSwarm(BaseSwarm): 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): """ Implements a star swarm where a central agent processes all tasks, followed by others. diff --git a/tests/structs/test_swarm_architectures.py b/tests/structs/test_swarm_architectures.py index cbe7d4d8..7be89129 100644 --- a/tests/structs/test_swarm_architectures.py +++ b/tests/structs/test_swarm_architectures.py @@ -8,7 +8,6 @@ from swarms.structs.swarming_architectures import ( geometric_swarm, grid_swarm, harmonic_swarm, - linear_swarm, log_swarm, mesh_swarm, one_to_one, @@ -69,21 +68,6 @@ def test_grid_swarm(): 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(): """Test star swarm with central and peripheral agents""" agents = create_test_agents(4)