diff --git a/swarms/agents/base.py b/swarms/agents/base.py new file mode 100644 index 00000000..57618ff8 --- /dev/null +++ b/swarms/agents/base.py @@ -0,0 +1,27 @@ +class AbsractAgent: + def __init__( + self, + llm, + temperature + ) -> None: + pass + + #single query + def run(self, task: str): + pass + + # # conversational back and forth + # def chat(self, message: str): + # message_historys = [] + # message_historys.append(message) + + # reply = self.run(message) + # message_historys.append(reply) + + # return message_historys + + # def step(self, message): + # pass + + # def reset(self): + # pass diff --git a/swarms/agents/omni_modal_agent.py b/swarms/agents/omni_modal_agent.py index dbb1bd15..5a14c3bc 100644 --- a/swarms/agents/omni_modal_agent.py +++ b/swarms/agents/omni_modal_agent.py @@ -103,6 +103,7 @@ class OmniModalAgent: self.chat_planner = load_chat_planner(llm) self.response_generator = load_response_generator(llm) # self.task_executor = TaskExecutor + self.history = [] def run( diff --git a/swarms/models/base.py b/swarms/models/base.py index 3e747a50..cb3ecbf5 100644 --- a/swarms/models/base.py +++ b/swarms/models/base.py @@ -3,7 +3,7 @@ from abc import ABC, abstractmethod class AbstractModel(ABC): #abstract base class for language models @abstractmethod - def generate(self, prompt): + def run(self, prompt): #generate text using language model pass diff --git a/swarms/tools/autogpt.py b/swarms/tools/autogpt.py index 611f2a3e..33582a06 100644 --- a/swarms/tools/autogpt.py +++ b/swarms/tools/autogpt.py @@ -132,7 +132,9 @@ import interpreter @tool def compile(task: str): """ - Open Interpreter lets LLMs run code (Python, Javascript, Shell, and more) locally. You can chat with Open Interpreter through a ChatGPT-like interface in your terminal by running $ interpreter after installing. + Open Interpreter lets LLMs run code (Python, Javascript, Shell, and more) locally. + You can chat with Open Interpreter through a ChatGPT-like interface in your terminal + by running $ interpreter after installing. This provides a natural-language interface to your computer's general-purpose capabilities: @@ -142,7 +144,6 @@ def compile(task: str): ...etc. ⚠️ Note: You'll be asked to approve code before it's run. """ - task = interpreter.chat(task, return_messages=True) interpreter.chat() interpreter.reset(task) @@ -156,7 +157,6 @@ def compile(task: str): # mm model workers - import torch from PIL import Image from transformers import ( diff --git a/swarms/tools/stt.py b/swarms/tools/stt.py index 22327115..65b12306 100644 --- a/swarms/tools/stt.py +++ b/swarms/tools/stt.py @@ -39,7 +39,6 @@ class SpeechToText: subprocess.run(["pip", "install", "pydub"]) - def download_youtube_video(self): audio_file = f'video.{self.audio_format}' diff --git a/swarms/workers/worker.py b/swarms/workers/worker.py index be729253..5753aeef 100644 --- a/swarms/workers/worker.py +++ b/swarms/workers/worker.py @@ -142,7 +142,7 @@ class Worker: query_website_tool, HumanInputRun(), compile, - # VQAinference + # VQAinference, ] if external_tools is not None: self.tools.extend(external_tools) @@ -310,7 +310,4 @@ class Worker: """ for token in response.split(): - yield token - - - + yield token \ No newline at end of file