Chris commited on
Commit
b55bafd
·
1 Parent(s): 33c409d

Final 7.6.3

Browse files
src/agents/synthesizer.py CHANGED
@@ -97,7 +97,7 @@ class SynthesizerAgent:
97
  analysis_parts = []
98
 
99
  # Add successful results first
100
- successful_results = [r for r in state.agent_results.values() if r.success]
101
  if successful_results:
102
  analysis_parts.append("=== SUCCESSFUL AGENT RESULTS ===")
103
  for result in successful_results:
@@ -108,7 +108,7 @@ Reasoning: {result.reasoning}
108
  """)
109
 
110
  # Add failed results with useful information
111
- failed_results = [r for r in state.agent_results.values() if not r.success]
112
  if failed_results:
113
  analysis_parts.append("\n=== ADDITIONAL CONTEXT ===")
114
  for result in failed_results:
@@ -197,7 +197,7 @@ Think carefully but respond with ONLY the answer:"""
197
  """Simple synthesis for single agent results or fallback"""
198
 
199
  # Find the best available result
200
- successful_results = [r for r in state.agent_results.values() if r.success]
201
 
202
  if successful_results:
203
  best_result = max(successful_results, key=lambda r: r.confidence)
@@ -207,7 +207,7 @@ Think carefully but respond with ONLY the answer:"""
207
  }
208
  else:
209
  # Try to extract useful info from failures
210
- all_results = list(state.agent_results.values())
211
  if all_results:
212
  fallback_result = all_results[0] # Use first available result
213
  return {
 
97
  analysis_parts = []
98
 
99
  # Add successful results first
100
+ successful_results = [r for r in state.agent_results if r.success]
101
  if successful_results:
102
  analysis_parts.append("=== SUCCESSFUL AGENT RESULTS ===")
103
  for result in successful_results:
 
108
  """)
109
 
110
  # Add failed results with useful information
111
+ failed_results = [r for r in state.agent_results if not r.success]
112
  if failed_results:
113
  analysis_parts.append("\n=== ADDITIONAL CONTEXT ===")
114
  for result in failed_results:
 
197
  """Simple synthesis for single agent results or fallback"""
198
 
199
  # Find the best available result
200
+ successful_results = [r for r in state.agent_results if r.success]
201
 
202
  if successful_results:
203
  best_result = max(successful_results, key=lambda r: r.confidence)
 
207
  }
208
  else:
209
  # Try to extract useful info from failures
210
+ all_results = list(state.agent_results)
211
  if all_results:
212
  fallback_result = all_results[0] # Use first available result
213
  return {
src/app.py CHANGED
@@ -341,12 +341,12 @@ class GAIAAgentApp:
341
  details.append(f"💰 **Cost**: ${state.total_cost:.4f}")
342
 
343
  # Agents used
344
- agents_used = [result.agent_role.value for result in state.agent_results.values()]
345
  details.append(f"🤖 **Agents Used**: {', '.join(agents_used) if agents_used else 'None'}")
346
 
347
  # Tools used
348
  tools_used = []
349
- for result in state.agent_results.values():
350
  tools_used.extend(result.tools_used)
351
  unique_tools = list(set(tools_used))
352
  details.append(f"🔧 **Tools Used**: {', '.join(unique_tools) if unique_tools else 'None'}")
@@ -387,8 +387,8 @@ class GAIAAgentApp:
387
 
388
  # Agent results
389
  reasoning.append("## 🤖 Agent Processing")
390
- for i, (agent_role, result) in enumerate(state.agent_results.items(), 1):
391
- reasoning.append(f"### Agent {i}: {agent_role.value}")
392
  reasoning.append(f"**Success**: {'✅' if result.success else '❌'}")
393
  reasoning.append(f"**Confidence**: {result.confidence:.2f}")
394
  reasoning.append(f"**Tools Used**: {', '.join(result.tools_used) if result.tools_used else 'None'}")
 
341
  details.append(f"💰 **Cost**: ${state.total_cost:.4f}")
342
 
343
  # Agents used
344
+ agents_used = [result.agent_role.value for result in state.agent_results]
345
  details.append(f"🤖 **Agents Used**: {', '.join(agents_used) if agents_used else 'None'}")
346
 
347
  # Tools used
348
  tools_used = []
349
+ for result in state.agent_results:
350
  tools_used.extend(result.tools_used)
351
  unique_tools = list(set(tools_used))
352
  details.append(f"🔧 **Tools Used**: {', '.join(unique_tools) if unique_tools else 'None'}")
 
387
 
388
  # Agent results
389
  reasoning.append("## 🤖 Agent Processing")
390
+ for i, result in enumerate(state.agent_results, 1):
391
+ reasoning.append(f"### Agent {i}: {result.agent_role.value}")
392
  reasoning.append(f"**Success**: {'✅' if result.success else '❌'}")
393
  reasoning.append(f"**Confidence**: {result.confidence:.2f}")
394
  reasoning.append(f"**Tools Used**: {', '.join(result.tools_used) if result.tools_used else 'None'}")
src/workflow/gaia_workflow.py CHANGED
@@ -148,7 +148,7 @@ class GAIAWorkflow:
148
 
149
  # Check if we need to run additional agents
150
  selected_agents = state.selected_agents
151
- executed_agents = set(state.agent_results.keys())
152
 
153
  # Find agents that haven't been executed yet
154
  remaining_agents = [
 
148
 
149
  # Check if we need to run additional agents
150
  selected_agents = state.selected_agents
151
+ executed_agents = set(result.agent_role for result in state.agent_results)
152
 
153
  # Find agents that haven't been executed yet
154
  remaining_agents = [