Former-commit-id: 0de94f802f
discord-bot-framework
Kye 1 year ago
parent 84a66bc981
commit 47b07560ce

@ -0,0 +1,5 @@
# from swarms.apps.base import App
"""
from swarms.apps import App
"""

@ -0,0 +1,26 @@
#base App class
class App:
"""
This is a base app class for examples
Args:
worker: Worker Agent
Usage
app = App(Worker)
app.run()
"""
def __init__(
self,
worker,
):
self.worker = worker
self.worker.app = self
def run(self, task):
"""Run the app"""
pass

@ -15,5 +15,4 @@ logo2 = """
/_______ / \__/\ / \____|__ /|____|_ /\____|__ //_______ /
\/ \/ \/ \/ \/ \/
"""
# print(logo2)
"""

@ -40,7 +40,7 @@ class Worker:
- `llm` (ChatOpenAI): Pre-initialized ChatOpenAI model instance (optional).
- `openai` (bool): If True, use the OpenAI language model; otherwise, use `llm` (default: True).
#Usage
Usage
```
from swarms import Worker
@ -91,6 +91,7 @@ class Worker:
@property
def name(self):
"""Name of the agent"""
return self.ai_name
def receieve(self, name: str, message: str) -> None:
@ -104,9 +105,11 @@ class Worker:
self.message_history.append(f"{name}: {message}")
def send(self) -> str:
"""Send message history."""
self.agent.run(task=self.message_history)
def add(self, task, priority=0):
"""Add a task to the task queue."""
self.task_queue.append((priority, task))
def setup_tools(self, external_tools):

Loading…
Cancel
Save