File size: 1,392 Bytes
db6dcad
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/usr/bin/env python3
"""
Test the enhanced upload.py with Ollama integration
"""
from upload import EnhancedDataExplorer

def test_enhanced_explorer():
    print("πŸš€ Testing Enhanced Data Explorer with Ollama...")
    
    try:
        # Initialize the explorer
        explorer = EnhancedDataExplorer()
        
        # Check status
        print("\nπŸ“‹ Checking system status:")
        explorer.check_status()
        
        # Load data
        print("\nπŸ“ Loading data:")
        data = explorer.load_data()
        
        if data is not None:
            print(f"βœ… Data loaded successfully: {data.shape}")
            
            # Test AI analysis if agent is available
            if explorer.agent is not None:
                print("\nπŸ€– Testing AI analysis:")
                response = explorer.ai_analysis("What are the main log levels in this data?")
                if response:
                    print("βœ… AI analysis completed successfully!")
                else:
                    print("⚠️  AI analysis returned no response")
            else:
                print("❌ No AI agent configured")
        else:
            print("❌ Failed to load data")
            
    except Exception as e:
        print(f"❌ Test failed: {e}")
        import traceback
        traceback.print_exc()

if __name__ == "__main__":
    test_enhanced_explorer()