#!/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()