Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Unable to run SequentialWorkflow #452

Open
adtygan opened this issue Apr 25, 2024 · 2 comments
Open

[BUG] Unable to run SequentialWorkflow #452

adtygan opened this issue Apr 25, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@adtygan
Copy link
Contributor

adtygan commented Apr 25, 2024

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:
Screenshot 2024-04-25 at 3 38 35 PM

Moreover, the 2 agents don't seem to be solving the task given to them.
Screenshot 2024-04-25 at 3 39 54 PM

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:

self.workflow_bootup()
`

workflow_bootup() is defined in

def workflow_bootup(self, **kwargs) -> None:

So in my understanding, swarms/structs/sequential_workflow.py is not properly importing from swarms/structs/base_workflow.py.

Request some assistance on this.

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@adtygan adtygan added the bug Something isn't working label Apr 25, 2024
Copy link

Hello there, thank you for opening an Issue ! 🙏🏻 The team was notified and they will get back to you asap.

@kyegomez
Copy link
Owner

@adtygan Fixing it right now, it'll be finished soon. excuse me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants