You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.1 KiB
43 lines
1.1 KiB
from swarms.structs.tree_swarm import ForestSwarm, Tree, TreeAgent
|
|
|
|
|
|
agents_tree1 = [
|
|
TreeAgent(
|
|
system_prompt="Stock Analysis Agent",
|
|
agent_name="Stock Analysis Agent",
|
|
),
|
|
TreeAgent(
|
|
system_prompt="Financial Planning Agent",
|
|
agent_name="Financial Planning Agent",
|
|
),
|
|
TreeAgent(
|
|
agent_name="Retirement Strategy Agent",
|
|
system_prompt="Retirement Strategy Agent",
|
|
),
|
|
]
|
|
|
|
agents_tree2 = [
|
|
TreeAgent(
|
|
system_prompt="Tax Filing Agent",
|
|
agent_name="Tax Filing Agent",
|
|
),
|
|
TreeAgent(
|
|
system_prompt="Investment Strategy Agent",
|
|
agent_name="Investment Strategy Agent",
|
|
),
|
|
TreeAgent(
|
|
system_prompt="ROTH IRA Agent", agent_name="ROTH IRA Agent"
|
|
),
|
|
]
|
|
|
|
# Create trees
|
|
tree1 = Tree(tree_name="Financial Tree", agents=agents_tree1)
|
|
tree2 = Tree(tree_name="Investment Tree", agents=agents_tree2)
|
|
|
|
# Create the ForestSwarm
|
|
multi_agent_structure = ForestSwarm(trees=[tree1, tree2])
|
|
|
|
# Run a task
|
|
task = "Our company is incorporated in delaware, how do we do our taxes for free?"
|
|
multi_agent_structure.run(task)
|