@echo off
setlocal
cd /d "%~dp0"

echo [AI] Checking Python 3.11...
py -3.11 --version
if errorlevel 1 (
    echo [AI][ERROR] Python 3.11 x64 is required.
    pause
    exit /b 1
)

if exist ".venv\Scripts\python.exe" (
    echo [AI] .venv already exists.
) else (
    echo [AI] Creating virtual environment...
    py -3.11 -m venv .venv
    if errorlevel 1 (
        echo [AI][ERROR] Failed to create .venv.
        pause
        exit /b 1
    )
)

echo [AI] Upgrading pip...
.venv\Scripts\python.exe -m pip install --upgrade pip

echo [AI] Done.
pause
