fix sequential workflow example

add langchain-anthropic to reqs
redo indentation of example
pull/541/head
evelynmitchell 6 months ago committed by GitHub
parent a811a81b9b
commit 4f616feddd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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."
)
```

@ -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"

@ -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

Loading…
Cancel
Save