Skip to content

Commit

Permalink
swarms docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Kye committed Nov 16, 2023
1 parent 9efcbff commit 9b4b61f
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 28 deletions.
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,11 @@ out = flow.run("Generate a 10,000 word blog on health and wellness.")
- Integrate Flow's with various LLMs and Multi-Modality Models

```python
from swarms.models import OpenAIChat
from swarms.models import OpenAIChat, BioGPT, Anthropic
from swarms.structs import Flow
from swarms.structs.sequential_workflow import SequentialWorkflow


# Example usage
api_key = (
"" # Your actual API key here
Expand All @@ -109,13 +110,21 @@ llm = OpenAIChat(
max_tokens=3000,
)

# Initialize the Flow with the language flow
biochat = BioGPT()

# Use Anthropic
anthropic = Anthropic()

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

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

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

# agent4 = Flow(llm=anthropic, max_loops="auto")

# Create the workflow
workflow = SequentialWorkflow(max_loops=1)
Expand Down
15 changes: 0 additions & 15 deletions docs/swarms/index.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,7 @@
# Swarms

<div align="center">

Swarms is a modular framework that enables reliable and useful multi-agent collaboration at scale to automate real-world tasks.

<!--
[![GitHub issues](https://img.shields.io/github/issues/kyegomez/swarms)](https://github.com/kyegomez/swarms/issues) [![GitHub forks](https://img.shields.io/github/forks/kyegomez/swarms)](https://github.com/kyegomez/swarms/network) [![GitHub stars](https://img.shields.io/github/stars/kyegomez/swarms)](https://github.com/kyegomez/swarms/stargazers) [![GitHub license](https://img.shields.io/github/license/kyegomez/swarms)](https://github.com/kyegomez/swarms/blob/main/LICENSE)[![GitHub star chart](https://img.shields.io/github/stars/kyegomez/swarms?style=social)](https://star-history.com/#kyegomez/swarms)[![Dependency Status](https://img.shields.io/librariesio/github/kyegomez/swarms)](https://libraries.io/github/kyegomez/swarms) [![Downloads](https://static.pepy.tech/badge/swarms/month)](https://pepy.tech/project/swarms)
### Share on Social Media
[![Join the Agora discord](https://img.shields.io/discord/1110910277110743103?label=Discord&logo=discord&logoColor=white&style=plastic&color=d7b023)![Share on Twitter](https://img.shields.io/twitter/url/https/twitter.com/cloudposse.svg?style=social&label=Share%20%40kyegomez/swarms)](https://twitter.com/intent/tweet?text=Check%20out%20this%20amazing%20AI%20project:%20&url=https%3A%2F%2Fgithub.com%2Fkyegomez%2Fswarms) [![Share on Facebook](https://img.shields.io/badge/Share-%20facebook-blue)](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fgithub.com%2Fkyegomez%2Fswarms) [![Share on LinkedIn](https://img.shields.io/badge/Share-%20linkedin-blue)](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fgithub.com%2Fkyegomez%2Fswarms&title=&summary=&source=)
[![Share on Reddit](https://img.shields.io/badge/-Share%20on%20Reddit-orange)](https://www.reddit.com/submit?url=https%3A%2F%2Fgithub.com%2Fkyegomez%2Fswarms&title=Swarms%20-%20the%20future%20of%20AI) [![Share on Hacker News](https://img.shields.io/badge/-Share%20on%20Hacker%20News-orange)](https://news.ycombinator.com/submitlink?u=https%3A%2F%2Fgithub.com%2Fkyegomez%2Fswarms&t=Swarms%20-%20the%20future%20of%20AI) [![Share on Pinterest](https://img.shields.io/badge/-Share%20on%20Pinterest-red)](https://pinterest.com/pin/create/button/?url=https%3A%2F%2Fgithub.com%2Fkyegomez%2Fswarms&media=https%3A%2F%2Fexample.com%2Fimage.jpg&description=Swarms%20-%20the%20future%20of%20AI) [![Share on WhatsApp](https://img.shields.io/badge/-Share%20on%20WhatsApp-green)](https://api.whatsapp.com/send?text=Check%20out%20Swarms%20-%20the%20future%20of%20AI%20%23swarms%20%23AI%0A%0Ahttps%3A%2F%2Fgithub.com%2Fkyegomez%2Fswarms)
</div> -->

<!-- [![Swarm Fest](images/swarmfest.png)](https://github.com/users/kyegomez/projects/1) -->

## Vision
At Swarms, we're transforming the landscape of AI from siloed AI agents to a unified 'swarm' of intelligence. Through relentless iteration and the power of collective insight from our 1500+ Agora researchers, we're developing a groundbreaking framework for AI collaboration. Our mission is to catalyze a paradigm shift, advancing Humanity with the power of unified autonomous AI agent swarms.
Expand Down
33 changes: 24 additions & 9 deletions sequential_workflow_example.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
from swarms.models import OpenAIChat
from swarms.models import OpenAIChat, BioGPT, Anthropic
from swarms.structs import Flow
from swarms.structs.sequential_workflow import SequentialWorkflow


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

# Initialize the language flow
llm = OpenAIChat(
Expand All @@ -12,24 +15,36 @@
max_tokens=3000,
)

# Initialize the Flow with the language flow
flow1 = Flow(llm=llm, max_loops=1, dashboard=False)
biochat = BioGPT()

# Use Anthropic
anthropic = Anthropic()

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

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

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

# agent4 = Flow(llm=anthropic, max_loops="auto")

# 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.", flow1)
workflow.add("Generate a 10,000 word blog on health and wellness.", agent1)

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

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

# Run the workflow
workflow.run()

# Output the results
for task in workflow.tasks:
print(f"Task: {task.description}, Result: {task.result}")
print(f"Task: {task.description}, Result: {task.result}")

0 comments on commit 9b4b61f

Please sign in to comment.