Schmitz005 commited on
Commit
6208c46
·
verified ·
1 Parent(s): 6753a28

Update whalecore/agents.py

Browse files
Files changed (1) hide show
  1. whalecore/agents.py +6 -9
whalecore/agents.py CHANGED
@@ -10,21 +10,18 @@ class Agent:
10
  # Placeholder logic for chatting
11
  return f"Hello from {self.name}! You said: {message[:260]}..."
12
 
13
- def load_agents(config_path="agentsConfig.YAML"):
14
  with open(config_path, 'r') as f:
15
  config = yaml.safe_load(f)
 
 
 
16
  agents = []
17
- for agent_conf in config.get('agents', []):
18
  agent = Agent(
19
  name=agent_conf['name'],
20
  persona=agent_conf['persona'],
21
  instructions=agent_conf['instructions']
22
  )
23
  agents.append(agent)
24
- return agents
25
-
26
- def run_agents_on_text(agent_list, text):
27
- results = {}
28
- for agent in agent_list:
29
- results[agent.name] = agent.chat(text)
30
- return results
 
10
  # Placeholder logic for chatting
11
  return f"Hello from {self.name}! You 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
+ print("🧠 YAML loaded:", config)
18
+
19
  agents = []
20
+ for agent_conf in config: # ✅ FLAT LIST FIX
21
  agent = Agent(
22
  name=agent_conf['name'],
23
  persona=agent_conf['persona'],
24
  instructions=agent_conf['instructions']
25
  )
26
  agents.append(agent)
27
+ return agents