From 7012784c914361e9d46a0114a6eba556261ad00e Mon Sep 17 00:00:00 2001 From: Hugh <155223694+hughiwnl@users.noreply.github.com> Date: Tue, 2 Dec 2025 11:47:50 -0800 Subject: [PATCH] removed mentions of linear --- docs/llm.txt | 50 ------------------- docs/swarms/examples/unique_swarms.md | 50 ------------------- .../utils/unique_swarms_examples.py | 24 --------- swarms/structs/swarming_architectures.py | 44 ---------------- 4 files changed, 168 deletions(-) diff --git a/docs/llm.txt b/docs/llm.txt index 51f90399..c6a7e85e 100644 --- a/docs/llm.txt +++ b/docs/llm.txt @@ -24130,32 +24130,6 @@ flowchart LR - Maintains strict ordering of task processing -### Linear Swarm -```python -def linear_swarm(agents: AgentListType, tasks: List[str], return_full_history: bool = True) -``` - -**Information Flow:** -```mermaid -flowchart LR - Input[Task Input] --> A1 - subgraph Sequential Processing - A1((Agent 1)) --> A2((Agent 2)) - A2 --> A3((Agent 3)) - A3 --> A4((Agent 4)) - A4 --> A5((Agent 5)) - end - A5 --> Output[Final Result] -``` - -**Best Used When:** - -- Tasks need sequential, pipeline-style processing - -- Each agent performs a specific transformation step - -- Order of processing is critical - ### Star Swarm ```python def star_swarm(agents: AgentListType, tasks: List[str], return_full_history: bool = True) @@ -24389,7 +24363,6 @@ flowchart TD ## Common Use Cases 1. **Data Processing Pipelines** - - Linear Swarm - Circular Swarm 2. **Distributed Computing** @@ -24528,29 +24501,6 @@ def run_healthcare_grid_swarm(): print("\nGrid swarm processing completed") print(result) -def run_finance_linear_swarm(): - """Loan approval process using linear swarm""" - print_separator() - print("FINANCE - LOAN APPROVAL PROCESS (Linear Swarm)") - - agents = create_finance_agents()[:3] - tasks = [ - "Review loan application and credit history", - "Assess risk factors and compliance requirements", - "Generate final loan recommendation" - ] - - print("\nTasks:") - for i, task in enumerate(tasks, 1): - print(f"{i}. {task}") - - result = linear_swarm(agents, tasks) - print("\nResults:") - for log in result['history']: - print(f"\n{log['agent_name']}:") - print(f"Task: {log['task']}") - print(f"Response: {log['response']}") - def run_healthcare_star_swarm(): """Complex medical case management using star swarm""" print_separator() diff --git a/docs/swarms/examples/unique_swarms.md b/docs/swarms/examples/unique_swarms.md index 00f55e95..245653af 100644 --- a/docs/swarms/examples/unique_swarms.md +++ b/docs/swarms/examples/unique_swarms.md @@ -61,32 +61,6 @@ flowchart LR - Maintains strict ordering of task processing -### Linear Swarm -```python -def linear_swarm(agents: AgentListType, tasks: List[str], return_full_history: bool = True) -``` - -**Information Flow:** -```mermaid -flowchart LR - Input[Task Input] --> A1 - subgraph Sequential Processing - A1((Agent 1)) --> A2((Agent 2)) - A2 --> A3((Agent 3)) - A3 --> A4((Agent 4)) - A4 --> A5((Agent 5)) - end - A5 --> Output[Final Result] -``` - -**Best Used When:** - -- Tasks need sequential, pipeline-style processing - -- Each agent performs a specific transformation step - -- Order of processing is critical - ### Star Swarm ```python def star_swarm(agents: AgentListType, tasks: List[str], return_full_history: bool = True) @@ -320,7 +294,6 @@ flowchart TD ## Common Use Cases 1. **Data Processing Pipelines** - - Linear Swarm - Circular Swarm 2. **Distributed Computing** @@ -459,29 +432,6 @@ def run_healthcare_grid_swarm(): print("\nGrid swarm processing completed") print(result) -def run_finance_linear_swarm(): - """Loan approval process using linear swarm""" - print_separator() - print("FINANCE - LOAN APPROVAL PROCESS (Linear Swarm)") - - agents = create_finance_agents()[:3] - tasks = [ - "Review loan application and credit history", - "Assess risk factors and compliance requirements", - "Generate final loan recommendation" - ] - - print("\nTasks:") - for i, task in enumerate(tasks, 1): - print(f"{i}. {task}") - - result = linear_swarm(agents, tasks) - print("\nResults:") - for log in result['history']: - print(f"\n{log['agent_name']}:") - print(f"Task: {log['task']}") - print(f"Response: {log['response']}") - def run_healthcare_star_swarm(): """Complex medical case management using star swarm""" print_separator() diff --git a/examples/multi_agent/utils/unique_swarms_examples.py b/examples/multi_agent/utils/unique_swarms_examples.py index 7f577e0b..6c315e25 100644 --- a/examples/multi_agent/utils/unique_swarms_examples.py +++ b/examples/multi_agent/utils/unique_swarms_examples.py @@ -121,30 +121,6 @@ def run_healthcare_grid_swarm(): print(result) -def run_finance_linear_swarm(): - """Loan approval process using linear swarm""" - print_separator() - print("FINANCE - LOAN APPROVAL PROCESS (Linear Swarm)") - - agents = create_finance_agents()[:3] - tasks = [ - "Review loan application and credit history", - "Assess risk factors and compliance requirements", - "Generate final loan recommendation", - ] - - print("\nTasks:") - for i, task in enumerate(tasks, 1): - print(f"{i}. {task}") - - result = linear_swarm(agents, tasks) - print("\nResults:") - for log in result["history"]: - print(f"\n{log['agent_name']}:") - print(f"Task: {log['task']}") - print(f"Response: {log['response']}") - - def run_healthcare_star_swarm(): """Complex medical case management using star swarm""" print_separator() diff --git a/swarms/structs/swarming_architectures.py b/swarms/structs/swarming_architectures.py index c286b653..033a083f 100644 --- a/swarms/structs/swarming_architectures.py +++ b/swarms/structs/swarming_architectures.py @@ -106,50 +106,6 @@ def grid_swarm( return history_output_formatter(conversation, output_type) - -# Linear Swarm: Agents process tasks in a sequential linear manner -def linear_swarm( - agents: AgentListType, - tasks: List[str], - output_type: OutputType = "dict", -) -> Union[Dict[str, Any], List[str]]: - """ - Implements a linear swarm where agents process tasks in a sequential manner. - - Args: - agents (AgentListType): A list of Agent objects to participate in the swarm. - tasks (List[str]): A list of tasks to be processed by the agents. - output_type (OutputType, optional): The format of the output. Defaults to "dict". - - Returns: - Union[Dict[str, Any], List[str]]: The formatted output of the swarm's processing. - If output_type is "dict", returns a dictionary containing the conversation history. - If output_type is "list", returns a list of responses. - - Raises: - ValueError: If agents or tasks lists are empty. - """ - if not agents or not tasks: - raise ValueError("Agents and tasks lists cannot be empty.") - - conversation = Conversation() - - for agent in agents: - if tasks: - task = tasks.pop(0) - conversation.add( - role="User", - content=task, - ) - response = agent.run(conversation.get_str()) - conversation.add( - role=agent.agent_name, - content=response, - ) - - return history_output_formatter(conversation, output_type) - - # Star Swarm: A central agent first processes all tasks, followed by others def star_swarm( agents: AgentListType,