idea read me update

main
Kye 2 years ago
parent 9afde2ab86
commit c3e53d6cfc

@ -5,6 +5,12 @@
[Swarms is brought to you by Agora, the open source AI research organization. Join Agora and Help create swarms and or recieve support to advance Humanity. ](https://discord.gg/qUtxnK2NMf)
# Swarming Language Models (Swarms)
[![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=)
Welcome to Swarms - the future of AI, where we leverage the power of autonomous agents to create 'swarms' of Language Models (LLM) that work together, creating a dynamic and interactive AI system.
@ -82,17 +88,59 @@ Here are three examples of swarming architectures that could be applied in this
If you love what we're building here, please consider sharing our project with your friends and colleagues! You can use the following buttons to share on social media.
[![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 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)
[![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 Facebook](https://img.shields.io/badge/Share-%20facebook-blue)](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fgithub.com%2Fkyegomez%2Fswarms)
[![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 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=)
## Contribute
We're always looking for contributors to help us improve and expand this project. If you're interested, please check out our [Contributing Guidelines](./CONTRIBUTING.md).
Thank you for being a part of our project!
# Ideas
A swarm, particularly in the context of distributed computing, refers to a large number of coordinated agents or nodes that work together to solve a problem. The specific requirements of a swarm might vary depending on the task at hand, but some of the general requirements include:
1. **Distributed Nature**: The swarm should consist of multiple individual units or nodes, each capable of functioning independently.
2. **Coordination**: The nodes in the swarm need to coordinate with each other to ensure they're working together effectively. This might involve communication between nodes, or it could be achieved through a central orchestrator.
3. **Scalability**: A well-designed swarm system should be able to scale up or down as needed, adding or removing nodes based on the task load.
4. **Resilience**: If a node in the swarm fails, it shouldn't bring down the entire system. Instead, other nodes should be able to pick up the slack.
5. **Load Balancing**: Tasks should be distributed evenly across the nodes in the swarm to avoid overloading any single node.
6. **Interoperability**: Each node should be able to interact with others, regardless of differences in underlying hardware or software.
Integrating these requirements with Large Language Models (LLMs) can be done as follows:
1. **Distributed Nature**: Each LLM agent can be considered as a node in the swarm. These agents can be distributed across multiple servers or even geographically dispersed data centers.
2. **Coordination**: An orchestrator can manage the LLM agents, assigning tasks, coordinating responses, and ensuring effective collaboration between agents.
3. **Scalability**: As the demand for processing power increases or decreases, the number of LLM agents can be adjusted accordingly.
4. **Resilience**: If an LLM agent goes offline or fails, the orchestrator can assign its tasks to other agents, ensuring the swarm continues functioning smoothly.
5. **Load Balancing**: The orchestrator can also handle load balancing, ensuring tasks are evenly distributed amongst the LLM agents.
6. **Interoperability**: By standardizing the input and output formats of the LLM agents, they can effectively communicate and collaborate, regardless of the specific model or configuration of each agent.
In terms of architecture, the swarm might look something like this:
```
(Orchestrator)
/ \
(LLM Agent)---(Communication Layer) (Communication Layer)---(LLM Agent)
/ | | \
(Task Assignment) (Task Completion) (Task Assignment) (Task Completion)
```
Each LLM agent communicates with the orchestrator through a dedicated communication layer. The orchestrator assigns tasks to each LLM agent, which the agents then complete and return. This setup allows for a high degree of flexibility, scalability, and robustness.
# To do:

@ -1,17 +1,18 @@
from __future__ import annotations
################
from core.prompts.input import EVAL_PREFIX, EVAL_SUFFIX
from core.tools.base import BaseToolSet
from core.tools.factory import ToolsFactory
############
from env import settings
from langchain.chat_models.base import BaseChatModel
from langchain.schema import BaseOutputParser
from langchain.callbacks.base import BaseCallbackManager
from .chat_agent import ConversationalChatAgent
from .llm import ChatOpenAI
from .parser import EvalOutputParser
class AgentBuilder:
def __init__(self, toolsets: list[BaseToolSet] = []):

@ -1330,6 +1330,53 @@ class BrowserActionTool(BaseTool):
name = "browser_action"
description = "Perform a browser action."
prompt = """
Sure, here are few-shot prompts for each of the browser tools:
1. **Go To URL Tool**
Prompt: "Navigate to the OpenAI homepage."
Command: `{ "action_type": "go_to", "url": "https://www.openai.com" }`
2. **Form Submission Tool**
Prompt: "On the page 'https://www.formexample.com', find the form with the id 'login', set the 'username' field to 'testuser', and the 'password' field to 'testpassword', then submit the form."
Command: `{ "action_type": "submit_form", "form_id": "login", "form_values": { "username": "testuser", "password": "testpassword" } }`
3. **Click Link Tool**
Prompt: "On the current page, find the link with the text 'About Us' and click it."
Command: `{ "action_type": "click_link", "link_text": "About Us" }`
4. **Enter Text Tool**
Prompt: "On the page 'https://www.textentryexample.com', find the text area with the id 'message' and enter the text 'Hello World'."
Command: `{ "action_type": "enter_text", "text_area_id": "message", "text": "Hello World" }`
5. **Button Click Tool**
Prompt: "On the current page, find the button with the id 'submit' and click it."
Command: `{ "action_type": "click_button", "button_id": "submit" }`
6. **Select Option Tool**
Prompt: "On the page 'https://www.selectoptionexample.com', find the select dropdown with the id 'country' and select the option 'United States'."
Command: `{ "action_type": "select_option", "select_id": "country", "option": "United States" }`
7. **Hover Tool**
Prompt: "On the current page, find the element with the id 'menu' and hover over it."
Command: `{ "action_type": "hover", "element_id": "menu" }`
8. **Scroll Tool**
Prompt: "On the current page, scroll down to the element with the id 'footer'."
Command: `{ "action_type": "scroll", "element_id": "footer" }`
9. **Screenshot Tool**
Prompt: "On the current page, take a screenshot."
Command: `{ "action_type": "screenshot" }`
10. **Back Navigation Tool**
Prompt: "Navigate back to the previous page."
Command: `{ "action_type": "back" }`
"""
def _run(self, action_type: str, action_details: dict) -> str:
"""Perform a browser action based on action_type and action_details."""

Loading…
Cancel
Save