Spaces:
Runtime error
Runtime error
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()
|