Singtel_Use_Case1 / test_enhanced.py
cosmoruler
stuck already
db6dcad
#!/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()