Spaces:
Sleeping
Sleeping
Update agents/base_agent.py
Browse files- agents/base_agent.py +15 -8
agents/base_agent.py
CHANGED
|
@@ -1,12 +1,19 @@
|
|
| 1 |
-
#
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
self.name = name
|
| 6 |
self.role = role
|
|
|
|
| 7 |
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
"""
|
| 12 |
-
raise NotImplementedError("Each agent must implement its own `run` method.")
|
|
|
|
| 1 |
+
# base_agent.py
|
| 2 |
|
| 3 |
+
from abc import ABC, abstractmethod
|
| 4 |
+
from multi_inference import multi_query
|
| 5 |
+
|
| 6 |
+
class ACPMessage:
|
| 7 |
+
def __init__(self, role, content):
|
| 8 |
+
self.role = role
|
| 9 |
+
self.content = content
|
| 10 |
+
|
| 11 |
+
class BaseAgent(ABC):
|
| 12 |
+
def __init__(self, name, role):
|
| 13 |
self.name = name
|
| 14 |
self.role = role
|
| 15 |
+
self.memory = []
|
| 16 |
|
| 17 |
+
@abstractmethod
|
| 18 |
+
def generate(self, messages):
|
| 19 |
+
pass
|
|
|
|
|
|