File size: 3,301 Bytes
9a6a4dc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/usr/bin/env python3
"""
Test Enhanced AGNO Agent with European Open-Source Multimodal Tools
"""

import os
import sys
import logging
from pathlib import Path

# Add the deployment-ready directory to the path
sys.path.insert(0, str(Path(__file__).parent))

# Set up logging
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)

def test_agent_initialization():
    """Test that the enhanced agent initializes correctly with multimodal tools."""
    print("πŸ§ͺ Testing Enhanced AGNO Agent with European Multimodal Tools...")
    
    try:
        from agents.enhanced_unified_agno_agent import GAIAAgent, get_agent_status
        
        print("βœ… Successfully imported enhanced agent")
        
        # Get agent status
        status = get_agent_status()
        print(f"πŸ“Š Agent Status: {status}")
        
        # Check if multimodal tools are available
        if status.get('multimodal_tools_available'):
            print("βœ… European open-source multimodal tools are available")
            multimodal_status = status.get('multimodal_status', {})
            if multimodal_status:
                print(f"πŸ‡ͺπŸ‡Ί Multimodal capabilities: {multimodal_status.get('capabilities', {})}")
                print(f"πŸ”§ Multimodal models: {multimodal_status.get('models', {})}")
        else:
            print("⚠️ European open-source multimodal tools not available")
        
        print(f"πŸ”§ Total tools available: {status.get('tools_count', 0)}")
        
        return True
        
    except Exception as e:
        print(f"❌ Error testing agent: {e}")
        import traceback
        traceback.print_exc()
        return False

def test_simple_question():
    """Test the agent with a simple question."""
    print("\nπŸ§ͺ Testing simple question processing...")
    
    try:
        from agents.enhanced_unified_agno_agent import process_question
        
        # Test with a simple mathematical question
        question = "What is 15 * 23?"
        print(f"❓ Question: {question}")
        
        answer = process_question(question)
        print(f"βœ… Answer: {answer}")
        
        return True
        
    except Exception as e:
        print(f"❌ Error processing question: {e}")
        import traceback
        traceback.print_exc()
        return False

def main():
    """Run all tests."""
    print("πŸš€ Starting Enhanced AGNO Agent Tests with European Multimodal Tools")
    print("=" * 70)
    
    # Test 1: Agent initialization
    test1_passed = test_agent_initialization()
    
    # Test 2: Simple question processing
    test2_passed = test_simple_question()
    
    print("\n" + "=" * 70)
    print("πŸ“Š Test Results:")
    print(f"  Agent Initialization: {'βœ… PASSED' if test1_passed else '❌ FAILED'}")
    print(f"  Simple Question: {'βœ… PASSED' if test2_passed else '❌ FAILED'}")
    
    if test1_passed and test2_passed:
        print("\nπŸŽ‰ All tests passed! Enhanced agent with European multimodal tools is working!")
        return True
    else:
        print("\n⚠️ Some tests failed. Check the logs above for details.")
        return False

if __name__ == "__main__":
    success = main()
    sys.exit(0 if success else 1)