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.
25 lines
743 B
25 lines
743 B
from swarms import Agent, SequentialWorkflow
|
|
|
|
# Agent 1: The Researcher
|
|
researcher = Agent(
|
|
agent_name="Researcher",
|
|
system_prompt="Your job is to research the provided topic and provide a detailed summary.",
|
|
model_name="gpt-4o-mini",
|
|
)
|
|
|
|
# Agent 2: The Writer
|
|
writer = Agent(
|
|
agent_name="Writer",
|
|
system_prompt="Your job is to take the research summary and write a beautiful, engaging blog post about it.",
|
|
model_name="gpt-4o-mini",
|
|
)
|
|
|
|
# Create a sequential workflow where the researcher's output feeds into the writer's input
|
|
workflow = SequentialWorkflow(agents=[researcher, writer])
|
|
|
|
# Run the workflow on a task
|
|
final_post = workflow.run(
|
|
"The history and future of artificial intelligence"
|
|
)
|
|
print(final_post)
|