Spaces:
Sleeping
Sleeping
Update agents/philosopher.py
Browse files- agents/philosopher.py +7 -6
agents/philosopher.py
CHANGED
|
@@ -1,14 +1,15 @@
|
|
| 1 |
# agents/philosopher.py
|
| 2 |
|
| 3 |
-
from agents.base_agent import BaseAgent
|
|
|
|
| 4 |
|
| 5 |
class PhilosopherAgent(BaseAgent):
|
| 6 |
def __init__(self):
|
| 7 |
-
super().__init__(name="🧙♂️ Philosopher", role="
|
| 8 |
|
| 9 |
-
def
|
|
|
|
| 10 |
try:
|
| 11 |
-
|
| 12 |
-
return query_func(query)
|
| 13 |
except Exception as e:
|
| 14 |
-
return f"[
|
|
|
|
| 1 |
# agents/philosopher.py
|
| 2 |
|
| 3 |
+
from agents.base_agent import BaseAgent, ACPMessage
|
| 4 |
+
from multi_inference import multi_query
|
| 5 |
|
| 6 |
class PhilosopherAgent(BaseAgent):
|
| 7 |
def __init__(self):
|
| 8 |
+
super().__init__(name="🧙♂️ Philosopher", role="Contemplates life and existence.")
|
| 9 |
|
| 10 |
+
def generate(self, messages):
|
| 11 |
+
prompt = f"{self.role}:\n" + "\n".join([f"{m.role}: {m.content}" for m in messages])
|
| 12 |
try:
|
| 13 |
+
return multi_query(prompt)
|
|
|
|
| 14 |
except Exception as e:
|
| 15 |
+
return f"[ERROR] {e}"
|