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.
swarms/sequential_workflow_with_ag...

41 lines
852 B

from swarms import Agent, OpenAIChat, SequentialWorkflow
# Example usage
llm = OpenAIChat(
temperature=0.5,
max_tokens=3000,
)
# Initialize the Agent with the language agent
agent1 = Agent(
agent_name="John the writer",
llm=llm,
max_loops=1,
dashboard=False,
)
# Create another Agent for a different task
agent2 = Agent("Summarizer", llm=llm, max_loops=1, dashboard=False)
# Create the workflow
workflow = SequentialWorkflow(
name="Blog Generation Workflow",
description=(
11 months ago
"Generate a youtube transcript on how to deploy agents into"
" production"
),
max_loops=1,
autosave=True,
dashboard=False,
agents=[agent1, agent2],
1 year ago
)
# Run the workflow
workflow.run()
# # # Output the results
# for task in workflow.tasks:
# print(f"Task: {task.description}, Result: {task.result}")