File size: 2,114 Bytes
6accb61
 
 
 
b36ff59
 
 
 
 
 
6accb61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
"""
Test the intelligent routing system to show how the orchestrator makes decisions.
"""

import os
import sys

# Add parent directory to path for imports
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

from agent import answer_gaia_question

def test_intelligent_routing():
    """Test cases that demonstrate the orchestrator's decision-making capabilities."""
    
    test_cases = [
        {
            "question": "What is the capital of France?",
            "expected_behavior": "Direct answer (simple factual question)"
        },
        {
            "question": "Calculate the sum of values in column A of the Excel file data.xlsx",
            "expected_behavior": "Route to retriever agent (file processing)"
        },
        {
            "question": "What is the current CEO of OpenAI as of 2024?",
            "expected_behavior": "Route to research agent (current information)"
        },
        {
            "question": "If a paper has a p-value of 0.04 and there were 1000 papers, how many would be false positives?",
            "expected_behavior": "Route to math agent (calculations)"
        },
        {
            "question": "List the prime numbers between 1 and 20, comma-separated",
            "expected_behavior": "Route to math agent OR direct answer"
        }
    ]
    
    print("🧠 Testing Intelligent Routing System")
    print("=" * 60)
    
    for i, test_case in enumerate(test_cases, 1):
        print(f"\nπŸ“ Test {i}: {test_case['question']}")
        print(f"🎯 Expected: {test_case['expected_behavior']}")
        print("-" * 40)
        
        try:
            # This will show the orchestrator's decision-making process
            print("πŸ”„ Processing...")
            answer = answer_gaia_question(test_case['question'], debug=True)
            print(f"βœ… Final Result: {answer}")
            
        except Exception as e:
            print(f"❌ Error: {e}")
            import traceback
            traceback.print_exc()
        
        print("-" * 60)

if __name__ == "__main__":
    test_intelligent_routing()