You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I'm trying to run a modified version (explained the change in To Reproduce section) of "Example 1: Adding Tasks to a Sequential Workflow" from the docs here and run into the following error:
Moreover, the 2 agents don't seem to be solving the task given to them.
To Reproduce
The code given in the blog post raises an error in the section #Create the Sequential Workflow as it expects the agents to be specified. Hence I passed them as parameters using agents=[flow1,flow2]. Code snippet to reproduce the behavior:
from swarms.models import OpenAIChat
from swarms.structs import Agent
from swarms.structs.sequential_workflow import SequentialWorkflow
# Initialize the language model agent (e.g., GPT-3)
llm = OpenAIChat(
openai_api_key="", # Enter OpenAI API key here
temperature=0.5,
max_tokens=3000,
)
# Initialize flows for individual tasks
flow1 = Agent(llm=llm, max_loops=1, dashboard=False)
flow2 = Agent(llm=llm, max_loops=1, dashboard=False)
# Create the Sequential Workflow
workflow = SequentialWorkflow(max_loops=1, agents=[flow1,flow2])
# Add tasks to the workflow
workflow.add("Generate a 10,000 word blog on health and wellness.", flow1)
workflow.add("Summarize the generated blog", flow2)
# Run the workflow
workflow.run()
# Output the results
for task in workflow.tasks:
print(f"Task: {task.description}, Result: {task.result}")
Expected behavior
At this stage, the agents are initialized and the run() function must iterate through each agent, calling each agent to execute tasks.
Additional context
The part of the code responsible for failure is:
Describe the bug
I'm trying to run a modified version (explained the change in To Reproduce section) of "Example 1: Adding Tasks to a Sequential Workflow" from the docs here and run into the following error:
Moreover, the 2 agents don't seem to be solving the task given to them.
To Reproduce
The code given in the blog post raises an error in the section
#Create the Sequential Workflow
as it expects the agents to be specified. Hence I passed them as parameters usingagents=[flow1,flow2]
. Code snippet to reproduce the behavior:Expected behavior
At this stage, the agents are initialized and the
run()
function must iterate through each agent, calling each agent to execute tasks.Additional context
The part of the code responsible for failure is:
swarms/swarms/structs/sequential_workflow.py
Line 150 in fe5a318
workflow_bootup()
is defined inswarms/swarms/structs/base_workflow.py
Line 371 in fe5a318
So in my understanding,
swarms/structs/sequential_workflow.py
is not properly importing fromswarms/structs/base_workflow.py
.Request some assistance on this.
Upvote & Fund
The text was updated successfully, but these errors were encountered: