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.
|
|
|
from swarms import Agent, SequentialWorkflow, Anthropic
|
|
|
|
|
|
|
|
|
|
|
|
# Initialize the language model agent (e.g., GPT-3)
|
|
|
|
llm = Anthropic()
|
|
|
|
|
|
|
|
# Initialize agents for individual tasks
|
|
|
|
agent1 = Agent(
|
|
|
|
agent_name="Blog generator",
|
|
|
|
system_prompt="Generate a blog post like stephen king",
|
|
|
|
llm=llm,
|
|
|
|
max_loops=1,
|
|
|
|
dashboard=False,
|
|
|
|
tools=[],
|
|
|
|
)
|
|
|
|
agent2 = Agent(
|
|
|
|
agent_name="summarizer",
|
|
|
|
system_prompt="Sumamrize the blog post",
|
|
|
|
llm=llm,
|
|
|
|
max_loops=1,
|
|
|
|
dashboard=False,
|
|
|
|
tools=[],
|
|
|
|
)
|
|
|
|
|
|
|
|
# Create the Sequential workflow
|
|
|
|
workflow = SequentialWorkflow(
|
|
|
|
agents=[agent1, agent2], max_loops=1, verbose=False
|
|
|
|
)
|
|
|
|
|
|
|
|
# Run the workflow
|
|
|
|
workflow.run(
|
|
|
|
"Generate a blog post on how swarms of agents can help businesses grow."
|
|
|
|
)
|