The best_score method expects agents with attribute score, but agents are dictionaries, not objects.
Step 2: Understand attribute vs key access
Using a.score on a dictionary causes an error; dictionaries need a['score'].
Final Answer:
Agents should be objects, not dictionaries -> Option A
Quick Check:
Attribute access on dict causes error [OK]
Hint: Use objects or adjust attribute access for dicts [OK]
Common Mistakes:
Thinking max() usage is wrong
Missing return statement (it exists)
Ignoring data type mismatch
5. You want to design a supervisor agent that combines outputs from three different AI agents solving a complex task. Which approach best fits the supervisor agent pattern?
hard
A. Collect outputs, evaluate quality, and select the best result
B. Run only the fastest agent and ignore others
C. Train all agents on the same data independently
D. Replace all agents with a single large model
Solution
Step 1: Understand supervisor agent's coordination role
The supervisor should gather outputs from all agents and decide which is best based on quality.
Step 2: Evaluate other options
Ignoring agents, training independently without coordination, or replacing agents contradict the supervisor pattern.
Final Answer:
Collect outputs, evaluate quality, and select the best result -> Option A
Quick Check:
Supervisor = collect + evaluate + select best [OK]
Hint: Supervisor picks best output from all agents [OK]