Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add swarm output schemas and agent fixes #743

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Occupying-Mars
Copy link
Collaborator

@Occupying-Mars Occupying-Mars commented Jan 10, 2025

Added two key methods to AgentRearrange class in swarms/structs/rearrange.py:
generate_flow(task_type, agent_groups): Generates flow patterns based on three types:
Sequential: "a -> b -> c"
Parallel: "a, b, c"
Hybrid: "(a, b) -> (c, d) -> e"
set_flow_from_task(task): Automatically analyzes task descriptions to determine appropriate flow patterns using keyword detection:
Parallel keywords: "compare", "analyze multiple", "parallel", "simultaneously"
Sequential keywords: "step by step", "in sequence", "following", "then"
Updated example code in new_features_examples/swarmarrange/swarm_arange_demo.py to demonstrate usage:
Sequential flow example for acquisition analysis
Parallel flow example for market research
Hybrid flow example with agent groupings for investment strategy


📚 Documentation preview 📚: https://swarms--743.org.readthedocs.build/en/743/

@@ -775,6 +775,67 @@
for attr_name, attr_value in self.__dict__.items()
}

def generate_flow(self, task_type: str = "sequential", agent_groups: Dict[str, List[str]] = None) -> str:

Check failure

Code scanning / Pyre

Incompatible variable type Error

Incompatible variable type [9]: agent_groups is declared to have type Dict[str, List[str]] but is used as type None.
@Occupying-Mars
Copy link
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant