-
-
Notifications
You must be signed in to change notification settings - Fork 516
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kye
committed
Mar 7, 2024
1 parent
b679ae9
commit e38f48d
Showing
9 changed files
with
131 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from swarms import Agent, MajorityVoting, ChromaDB, Anthropic | ||
|
||
# Initialize the llm | ||
llm = Anthropic() | ||
|
||
# Agents | ||
agent1 = Agent( | ||
llm = llm, | ||
system_prompt="You are the leader of the Progressive Party. What is your stance on healthcare?", | ||
agent_name="Progressive Leader", | ||
agent_description="Leader of the Progressive Party", | ||
long_term_memory=ChromaDB(), | ||
max_steps=1, | ||
) | ||
|
||
agent2 = Agent( | ||
llm=llm, | ||
agent_name="Conservative Leader", | ||
agent_description="Leader of the Conservative Party", | ||
long_term_memory=ChromaDB(), | ||
max_steps=1, | ||
) | ||
|
||
agent3 = Agent( | ||
llm=llm, | ||
agent_name="Libertarian Leader", | ||
agent_description="Leader of the Libertarian Party", | ||
long_term_memory=ChromaDB(), | ||
max_steps=1, | ||
) | ||
|
||
# Initialize the majority voting | ||
mv = MajorityVoting( | ||
agents=[agent1, agent2, agent3], | ||
output_parser=llm.majority_voting, | ||
autosave=False, | ||
verbose=True, | ||
) | ||
|
||
|
||
# Start the majority voting | ||
mv.run("What is your stance on healthcare?") |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api" | |
|
||
[tool.poetry] | ||
name = "swarms" | ||
version = "4.2.7" | ||
version = "4.2.8" | ||
description = "Swarms - Pytorch" | ||
license = "MIT" | ||
authors = ["Kye Gomez <[email protected]>"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters