Skip to content

Commit

Permalink
fix sequential workflow example
Browse files Browse the repository at this point in the history
add langchain-anthropic to reqs
redo indentation of example
  • Loading branch information
evelynmitchell authored Jul 16, 2024
1 parent a811a81 commit 4f616fe
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 32 deletions.
64 changes: 32 additions & 32 deletions docs/swarms/structs/sequential_workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,38 +37,38 @@ Runs the specified task through the agents in the dynamically constructed flow.
from swarms import Agent, SequentialWorkflow, Anthropic


# Initialize the language model agent (e.g., GPT-3)
llm = Anthropic()

# Place your key in .env

# 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."
)
# Initialize the language model agent (e.g., GPT-3)
llm = Anthropic()

# Place your key in .env

# 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."
)

```

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ transformers = ">= 4.39.0, <5.0.0"
asyncio = ">=3.4.3,<4.0"
langchain-community = "0.0.29"
langchain-experimental = "0.0.55"
langchain-anthropic = "*"
backoff = "2.2.1"
toml = "*"
pypdf = "4.3.0"
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ transformers>=4.39.0,<5.0.0
asyncio>=3.4.3,<4.0
langchain-community==0.0.29
langchain-experimental==0.0.55
langchain-anthropic
backoff==2.2.1
toml
pypdf==4.1.0
Expand Down

0 comments on commit 4f616fe

Please sign in to comment.