Spaces:
Sleeping
Sleeping
File size: 1,415 Bytes
ddabbe4 8d5b1f0 ddabbe4 |
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 46 47 48 49 50 51 52 53 54 55 56 |
"""
Main entry point for NBA 2024-25 data analysis using CrewAI.
"""
import os
import pandas as pd
from config import NBA_DATA_PATH
from crew import create_crew
def main():
"""Main function to run the NBA data analysis crew."""
print("=" * 60)
print("NBA 2024-25 Data Analysis with CrewAI")
from config import LLM_PROVIDER
print(f"Using LLM Provider: {LLM_PROVIDER.upper()}")
print("=" * 60)
print()
# Check if data file exists
if not os.path.exists(NBA_DATA_PATH):
print(f"Error: {NBA_DATA_PATH} not found!")
return
print(f"Loading data from {NBA_DATA_PATH}...")
try:
# Quick data preview
df = pd.read_csv(NBA_DATA_PATH)
print(f"Dataset loaded: {len(df)} records, {len(df.columns)} columns")
print(f"Columns: {', '.join(df.columns.tolist())}")
print()
except Exception as e:
print(f"Error loading data: {e}")
return
print("Starting CrewAI agents...")
print("Engineer Agent will process and clean the data...")
print("Analyst Agent will analyze the data for insights...")
print()
print("-" * 60)
print()
# Create and execute the crew
crew = create_crew()
result = crew.kickoff()
print()
print("=" * 60)
print("ANALYSIS COMPLETE")
print("=" * 60)
print()
print(result)
if __name__ == "__main__":
main()
|