#!/usr/bin/env python3 """ Quick AI Demo - Working SmoLagent without large model downloads """ import pandas as pd from smolagents import CodeAgent, DuckDuckGoSearchTool import warnings warnings.filterwarnings('ignore') def quick_demo(): """Quick demo that works immediately""" print("๐Ÿš€ QUICK AI DEMO - No Downloads Required") print("=" * 50) # Load the data first csv_file_path = "C:/Users/Cosmo/Desktop/NTU Peak Singtel/outsystems_sample_logs_6months.csv" try: print("๐Ÿ“Š Loading CSV data...") df = pd.read_csv(csv_file_path) print(f"โœ… Data loaded: {df.shape[0]} rows, {df.shape[1]} columns") print(f"๐Ÿ“‹ Columns: {list(df.columns)}") # Show basic analysis without AI first print("\n๐Ÿ“ˆ BASIC DATA ANALYSIS:") print("-" * 30) # Error analysis error_df = df[df['LogLevel'] == 'Error'] info_df = df[df['LogLevel'] == 'Info'] print(f"๐Ÿšจ Total Error entries: {len(error_df)}") print(f"โ„น๏ธ Total Info entries: {len(info_df)}") print(f"๐Ÿ“Š Error rate: {len(error_df)/len(df)*100:.1f}%") # Top modules with errors if not error_df.empty: top_error_modules = error_df['Module'].value_counts().head(3) print(f"\n๐Ÿ” Top 3 modules with errors:") for module, count in top_error_modules.items(): print(f" โ€ข {module}: {count} errors") # Check for missing data missing_data = df.isnull().sum() print(f"\nโŒ Missing data summary:") for col, missing_count in missing_data.items(): if missing_count > 0: print(f" โ€ข {col}: {missing_count} missing ({missing_count/len(df)*100:.1f}%)") print("\n" + "=" * 50) print("โœ… BASIC ANALYSIS COMPLETE!") print("๐Ÿ’ก This shows your data is loading correctly.") print("๐Ÿค– AI features will work once model downloads complete.") print("=" * 50) return df except Exception as e: print(f"โŒ Error loading data: {e}") return None def test_simple_agent(): """Test if we can create an agent without heavy models""" print("\n๐Ÿงช Testing Simple Agent Creation...") try: # Just test the tools without a model first search_tool = DuckDuckGoSearchTool() print("โœ… DuckDuckGo search tool created successfully") # Try to create agent (might fail without model, but we can catch it) try: agent = CodeAgent(tools=[search_tool]) print("โœ… Agent created (basic setup)") except Exception as e: print(f"โ„น๏ธ Agent needs model: {e}") print("๐Ÿ’ก This is expected - agent will work once model is ready") except Exception as e: print(f"โŒ Tool creation failed: {e}") if __name__ == "__main__": # Run the quick demo df = quick_demo() # Test agent creation test_simple_agent() if df is not None: print(f"\n๐ŸŽ‰ SUCCESS! Your data analysis setup is working!") print(f"๐Ÿ“Š Dataset ready: {df.shape[0]} OutSystems log entries") print(f"๐Ÿค– AI features will be available once model download completes")