Spaces:
Sleeping
Sleeping
Update whalecore/agents.py
Browse files- whalecore/agents.py +4 -6
whalecore/agents.py
CHANGED
@@ -7,19 +7,17 @@ class Agent:
|
|
7 |
self.instructions = instructions
|
8 |
|
9 |
def chat(self, message):
|
10 |
-
# Placeholder logic
|
11 |
-
return f"
|
12 |
|
13 |
def load_agents(config_path="config.yaml"):
|
14 |
-
print("📄 Parsed doc:", doc)
|
15 |
-
print("📄 Type of doc:", type(doc))
|
16 |
with open(config_path, 'r') as f:
|
17 |
config = yaml.safe_load(f)
|
18 |
|
19 |
-
assert isinstance(config, dict), "YAML
|
20 |
assert 'agents' in config, "Missing 'agents' key in YAML file"
|
21 |
|
22 |
-
print("🧠 YAML loaded:", config)
|
23 |
|
24 |
agents = []
|
25 |
for agent_conf in config['agents']:
|
|
|
7 |
self.instructions = instructions
|
8 |
|
9 |
def chat(self, message):
|
10 |
+
# Placeholder logic — replace with real LLM call later
|
11 |
+
return f"🧠 {self.name} says:\n{self.instructions}\n\n{self.persona}\n\nYou said: {message[:260]}..."
|
12 |
|
13 |
def load_agents(config_path="config.yaml"):
|
|
|
|
|
14 |
with open(config_path, 'r') as f:
|
15 |
config = yaml.safe_load(f)
|
16 |
|
17 |
+
assert isinstance(config, dict), "YAML must contain a top-level 'agents:' key"
|
18 |
assert 'agents' in config, "Missing 'agents' key in YAML file"
|
19 |
|
20 |
+
print("🧠 YAML loaded successfully:", config)
|
21 |
|
22 |
agents = []
|
23 |
for agent_conf in config['agents']:
|