diff --git a/groupchat.py b/groupchat.py index 739181d1..71d40a03 100644 --- a/groupchat.py +++ b/groupchat.py @@ -14,28 +14,28 @@ llm = OpenAI( flow1 = Flow( llm=llm, max_loops=1, - system_message="YOU ARE SILLY, YOU OFFER NOTHING OF VALUE", + system_prompt="YOU ARE SILLY, YOU OFFER NOTHING OF VALUE", name="silly", dashboard=True, ) flow2 = Flow( llm=llm, max_loops=1, - system_message="YOU ARE VERY SMART AND ANSWER RIDDLES", + system_prompt="YOU ARE VERY SMART AND ANSWER RIDDLES", name="detective", dashboard=True, ) flow3 = Flow( llm=llm, max_loops=1, - system_message="YOU MAKE RIDDLES", + system_prompt="YOU MAKE RIDDLES", name="riddler", dashboard=True, ) manager = Flow( llm=llm, max_loops=1, - system_message="YOU ARE A GROUP CHAT MANAGER", + system_prompt="YOU ARE A GROUP CHAT MANAGER", name="manager", dashboard=True, ) diff --git a/playground/workflow.py b/playground/workflow.py index a5d0ea03..78909dc7 100644 --- a/playground/workflow.py +++ b/playground/workflow.py @@ -1,5 +1,5 @@ from swarms import Workflow -from swarms.tools.autogpt import ChatOpenAI +from swarms.models import ChatOpenAI workflow = Workflow(ChatOpenAI) diff --git a/swarms/__init__.py b/swarms/__init__.py index dda0aff2..f1225d81 100644 --- a/swarms/__init__.py +++ b/swarms/__init__.py @@ -9,7 +9,6 @@ os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2" from swarms.workers import * -from swarms.workers.worker import Worker from swarms.chunkers import * from swarms.models import * # import * only works when __all__ = [] is defined in __init__.py from swarms.structs import * diff --git a/swarms/models/biogpt.py b/swarms/models/biogpt.py index f5abdf95..d8afcebd 100644 --- a/swarms/models/biogpt.py +++ b/swarms/models/biogpt.py @@ -105,12 +105,14 @@ class BioGPT: generator = pipeline( "text-generation", model=self.model, tokenizer=self.tokenizer ) - return generator( + out = generator( text, max_length=self.max_length, num_return_sequences=self.num_return_sequences, do_sample=self.do_sample, ) + + return out[0]['generated_text'] def get_features(self, text): """ diff --git a/swarms/tools/exit_conversation.py b/swarms/tools/exit_conversation.py deleted file mode 100644 index d1543e14..00000000 --- a/swarms/tools/exit_conversation.py +++ /dev/null @@ -1,22 +0,0 @@ -from langchain.tools import tool - -from swarms.tools.base import BaseToolSet, SessionGetter, ToolScope -from swarms.utils.logger import logger - - -class ExitConversation(BaseToolSet): - @tool( - name="Exit Conversation", - description="A tool to exit the conversation. " - "Use this when you want to exit the conversation. " - "The input should be a message that the conversation is over.", - scope=ToolScope.SESSION, - ) - def exit(self, message: str, get_session: SessionGetter) -> str: - """Run the tool.""" - _, executor = get_session() - del executor - - logger.debug("\nProcessed ExitConversation.") - - return message diff --git a/swarms/tools/requests.py b/swarms/tools/requests.py deleted file mode 100644 index fa60e8e4..00000000 --- a/swarms/tools/requests.py +++ /dev/null @@ -1,36 +0,0 @@ -import requests -from bs4 import BeautifulSoup - -from swarms.tools.base import BaseToolSet, tool -from swarms.utils.logger import logger - - -class RequestsGet(BaseToolSet): - @tool( - name="Requests Get", - description="A portal to the internet. " - "Use this when you need to get specific content from a website." - "Input should be a url (i.e. https://www.google.com)." - "The output will be the text response of the GET request.", - ) - def get(self, url: str) -> str: - """Run the tool.""" - html = requests.get(url).text - soup = BeautifulSoup(html) - non_readable_tags = soup.find_all( - ["script", "style", "header", "footer", "form"] - ) - - for non_readable_tag in non_readable_tags: - non_readable_tag.extract() - - content = soup.get_text("\n", strip=True) - - if len(content) > 300: - content = content[:300] + "..." - - logger.debug( - f"\nProcessed RequestsGet, Input Url: {url} " f"Output Contents: {content}" - ) - - return content