From b9d2aa3129f265e6305d7678083eb89e31ae734a Mon Sep 17 00:00:00 2001 From: Kye Date: Wed, 15 Nov 2023 21:24:33 -0500 Subject: [PATCH] swarms docs Former-commit-id: 9b4b61f9fede31c809b81ad4e27e5a46aaac4369 --- README.md | 17 +++++++++++++---- docs/swarms/index.md | 15 --------------- sequential_workflow_example.py | 33 ++++++++++++++++++++++++--------- 3 files changed, 37 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 1679b471..71f76a11 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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) diff --git a/docs/swarms/index.md b/docs/swarms/index.md index fc5c8e3e..a20bc9f7 100644 --- a/docs/swarms/index.md +++ b/docs/swarms/index.md @@ -1,22 +1,7 @@ # Swarms -
- Swarms is a modular framework that enables reliable and useful multi-agent collaboration at scale to automate real-world tasks. - - - ## 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. diff --git a/sequential_workflow_example.py b/sequential_workflow_example.py index 9dc9c828..9c17a072 100644 --- a/sequential_workflow_example.py +++ b/sequential_workflow_example.py @@ -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( @@ -12,24 +15,36 @@ llm = OpenAIChat( 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}") \ No newline at end of file