diff --git a/README.md b/README.md
index 4361355f..c53b81fa 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
-A modular framework that enables you to Build, Deploy, and Scale Reliable Autonomous Agents. Get started now below.
+Orchestrate swarms of agents for production-grade applications.
[![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)
@@ -15,7 +15,7 @@ A modular framework that enables you to Build, Deploy, and Scale Reliable Autono
----
-## Installation
+## Install
`pip3 install -U swarms`
---
diff --git a/docs/swarms_bounty_system.md b/docs/swarms_bounty_system.md
index aa08f34a..fff99138 100644
--- a/docs/swarms_bounty_system.md
+++ b/docs/swarms_bounty_system.md
@@ -52,7 +52,7 @@ This tier encompasses moderate enhancements to existing features, as well as the
| Reward | Description |
|------------------------|--------------------------------------------------------------|
-| Cash Reward | $301 - $500 |
+| Cash Reward | $301 - $++ |
| Stock Reward | 25+ |
This tier is reserved for truly exceptional contributions that have the potential to revolutionize the Swarms ecosystem. Major feature additions, innovative architectural improvements, and groundbreaking new projects fall under this category. Developers who contribute at this level will be recognized as thought leaders and pioneers in their respective fields.
diff --git a/message_pool.py b/message_pool.py
new file mode 100644
index 00000000..b5230a8e
--- /dev/null
+++ b/message_pool.py
@@ -0,0 +1,74 @@
+from swarms.structs.message_pool import MessagePool
+from swarms import Agent, OpenAIChat
+from swarms.memory.chroma_db import ChromaDB
+
+
+# Agents
+agent1 = Agent(
+ llm=OpenAIChat(system_prompt="You are a Minecraft player. What's your favorite building style?"),
+ agent_name="Steve",
+ agent_description="A Minecraft player agent",
+ long_term_memory=ChromaDB(),
+ max_steps=1,
+)
+
+agent2 = Agent(
+ llm=OpenAIChat(system_prompt="You are a Minecraft builder. What's your most impressive creation?"),
+ agent_name="Bob",
+ agent_description="A Minecraft builder agent",
+ long_term_memory=ChromaDB(),
+ max_steps=1,
+)
+
+agent3 = Agent(
+ llm=OpenAIChat(system_prompt="You are a Minecraft explorer. What's the most interesting place you've discovered?"),
+ agent_name="Alex",
+ agent_description="A Minecraft explorer agent",
+ long_term_memory=ChromaDB(),
+ max_steps=1,
+)
+
+agent4 = Agent(
+ llm=OpenAIChat(system_prompt="You are a Minecraft adventurer. What's the most dangerous situation you've been in?"),
+ agent_name="Ender",
+ agent_description="A Minecraft adventurer agent",
+ long_term_memory=ChromaDB(),
+ max_steps=1,
+)
+
+moderator = Agent(
+ llm=OpenAIChat(system_prompt="You are a Minecraft moderator. How do you handle conflicts between players?"),
+ agent_name="Admin",
+ agent_description="A Minecraft moderator agent",
+ long_term_memory=ChromaDB(),
+ max_steps=1,
+)
+
+# Create a message pool
+pool = MessagePool(
+ moderator=moderator,
+ agents=[agent1, agent2, agent3, agent4],
+ turns=4,
+ show_names=True,
+ autosave=True,
+)
+
+# Add a message to the pool
+pool.add(
+ agent=agent1,
+ content="Hello, agent2!",
+ turn=1,
+)
+
+
+# Get all messages
+out = pool.get_all_messages()
+print(out)
+
+
+# Get visible messages
+messages = pool.get_visible_messages(agent=agent1, turn=1)
+print(messages)
+
+# Get visible messages
+# pool.query("Hello, agent2!")
diff --git a/swarms/__init__.py b/swarms/__init__.py
index 66063891..1177bf6e 100644
--- a/swarms/__init__.py
+++ b/swarms/__init__.py
@@ -1,5 +1,7 @@
# from swarms.telemetry.main import Telemetry # noqa: E402, F403
from swarms.telemetry.bootup import bootup # noqa: E402, F403
+import os
+os.environ["WANDB_SILENT"] = "true"
bootup()
diff --git a/swarms/memory/chroma_db.py b/swarms/memory/chroma_db.py
index a926dd11..df59ea99 100644
--- a/swarms/memory/chroma_db.py
+++ b/swarms/memory/chroma_db.py
@@ -99,7 +99,7 @@ class ChromaDB:
name=output_dir,
metadata={"hnsw:space": metric},
embedding_function=self.embedding_function,
- data_loader=self.data_loader,
+ # data_loader=self.data_loader,
*args,
**kwargs,
)
diff --git a/swarms/structs/__init__.py b/swarms/structs/__init__.py
index 690a64f3..12186129 100644
--- a/swarms/structs/__init__.py
+++ b/swarms/structs/__init__.py
@@ -37,7 +37,6 @@ from swarms.structs.schemas import (
TaskRequestBody,
)
from swarms.structs.sequential_workflow import SequentialWorkflow
-from swarms.structs.stackoverflow_swarm import StackOverflowSwarm
from swarms.structs.step import Step
from swarms.structs.swarm_net import SwarmNetwork
from swarms.structs.swarming_architectures import (
@@ -135,7 +134,6 @@ __all__ = [
"parse_code_completion",
"majority_voting",
"MajorityVoting",
- "StackOverflowSwarm",
"synchronized_queue",
"TaskQueueBase",
"MultiProcessingWorkflow",
diff --git a/swarms/structs/base_swarm.py b/swarms/structs/base_swarm.py
index 90ec89d9..b23e1549 100644
--- a/swarms/structs/base_swarm.py
+++ b/swarms/structs/base_swarm.py
@@ -1,7 +1,7 @@
import yaml
import json
import asyncio
-from abc import ABC, abstractmethod
+from abc import ABC
from concurrent.futures import ThreadPoolExecutor, as_completed
from typing import Any, Callable, Dict, List, Optional, Sequence
from swarms.utils.loguru_logger import logger
@@ -463,7 +463,7 @@ class AbstractSwarm(ABC):
)
return list(responses)
- @abstractmethod
+ # @abstractmethod
def add_swarm_entry(self, swarm):
"""
Add the information of a joined Swarm to the registry.
diff --git a/swarms/structs/message_pool.py b/swarms/structs/message_pool.py
index 37dbb19e..96467fd9 100644
--- a/swarms/structs/message_pool.py
+++ b/swarms/structs/message_pool.py
@@ -3,7 +3,6 @@ from time import time_ns
from typing import Callable, List, Optional, Sequence, Union
from swarms.structs.agent import Agent
-from swarms.structs.base_swarm import BaseSwarm
from swarms.utils.loguru_logger import logger
@@ -43,7 +42,7 @@ def msg_hash(
)
-class MessagePool(BaseSwarm):
+class MessagePool:
"""
A class representing a message pool for agents in a swarm.
@@ -203,12 +202,12 @@ class MessagePool(BaseSwarm):
visible_messages.append(message)
return visible_messages
- def query(self, query: str):
- """
- Query a message from the messages list and then pass it to the moderator
- """
- return [
- (mod, content)
- for mod, content in self.messages
- if mod == self.moderator
- ]
+ # def query(self, query: str):
+ # """
+ # Query a message from the messages list and then pass it to the moderator
+ # """
+ # return [
+ # (mod, content)
+ # for mod, content, _ in self.messages # Add an underscore to ignore the rest of the elements
+ # if query in content
+ # ]
\ No newline at end of file
diff --git a/swarms/utils/__init__.py b/swarms/utils/__init__.py
index ea5e8a52..01e22f93 100644
--- a/swarms/utils/__init__.py
+++ b/swarms/utils/__init__.py
@@ -18,7 +18,6 @@ from swarms.utils.download_weights_from_url import (
from swarms.utils.exponential_backoff import ExponentialBackoffMixin
from swarms.utils.file_processing import (
load_json,
- parse_tagged_output,
sanitize_file_path,
zip_workspace,
create_file_in_folder,
@@ -97,7 +96,6 @@ __all__ = [
"dataframe_to_text",
"zip_workspace",
"sanitize_file_path",
- "parse_tagged_output",
"load_json",
"csv_to_dataframe",
"dataframe_to_strings",
diff --git a/swarms/utils/json_utils.py b/swarms/utils/json_utils.py
index 9fba5557..b4e452e4 100644
--- a/swarms/utils/json_utils.py
+++ b/swarms/utils/json_utils.py
@@ -15,3 +15,21 @@ def base_model_schema_to_json(model: BaseModel):
str: The JSON schema of the base model as a formatted JSON string.
"""
return json.dumps(model.model_json_schema(), indent=2)
+
+
+def extract_json_from_str(response: str):
+ """
+ Extracts a JSON object from a string.
+
+ Args:
+ response (str): The string containing the JSON object.
+
+ Returns:
+ dict: The extracted JSON object.
+
+ Raises:
+ ValueError: If the string does not contain a valid JSON object.
+ """
+ json_start = response.index("{")
+ json_end = response.rfind("}")
+ return json.loads(response[json_start : json_end + 1])