Skip to content

Commit

Permalink
[README]
Browse files Browse the repository at this point in the history
  • Loading branch information
kyegomez committed Nov 30, 2023
1 parent 6e42d54 commit 4e47528
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,17 @@ out = agent.run("Generate a 10,000 word blog on health and wellness.")
- Integrate Agent's with various LLMs and Multi-Modality Models

```python
from swarms.models import OpenAIChat, BioGPT, Anthropic
import os
from swarms.models import OpenAIChat
from swarms.structs import Agent
from swarms.structs.sequential_workflow import SequentialWorkflow
from dotenv import load_dotenv

load_dotenv()

# Load the environment variables
api_key = os.getenv("OPENAI_API_KEY")

# Example usage
api_key = (
"" # Your actual API key here
)

# Initialize the language agent
llm = OpenAIChat(
Expand All @@ -90,32 +92,28 @@ llm = OpenAIChat(
max_tokens=3000,
)

biochat = BioGPT()

# Use Anthropic
anthropic = Anthropic()

# Initialize the agent with the language agent
agent1 = Agent(llm=llm, max_loops=1, dashboard=False)
agent1 = Agent(llm=llm, max_loops=1)

# Create another agent for a different task
agent2 = Agent(llm=llm, max_loops=1, dashboard=False)
agent2 = Agent(llm=llm, max_loops=1)

# Create another agent for a different task
agent3 = Agent(llm=biochat, max_loops=1, dashboard=False)

# agent4 = Agent(llm=anthropic, max_loops="auto")
agent3 = Agent(llm=llm, max_loops=1)

# Create the workflow
workflow = SequentialWorkflow(max_loops=1)

# Add tasks to the workflow
workflow.add("Generate a 10,000 word blog on health and wellness.", agent1)
workflow.add(
agent1, "Generate a 10,000 word blog on health and wellness.",
)

# Suppose the next task takes the output of the first task as input
workflow.add("Summarize the generated blog", agent2)

workflow.add("Create a references sheet of materials for the curriculm", agent3)
workflow.add(
agent2, "Summarize the generated blog",
)

# Run the workflow
workflow.run()
Expand All @@ -124,6 +122,7 @@ workflow.run()
for task in workflow.tasks:
print(f"Task: {task.description}, Result: {task.result}")


```

## `Multi Modal Autonomous Agents`
Expand Down

0 comments on commit 4e47528

Please sign in to comment.