File size: 2,346 Bytes
dea8d0d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
"""
NeuraAI v500 Full Setup & Launcher
Author: CHATGPT + Joshua•Dav
"""

import os
import subprocess
import sys
import json
import time

# ----------------------------
# Helper: run shell commands safely
# ----------------------------
def run_cmd(cmd_list):
    try:
        subprocess.check_call(cmd_list)
    except subprocess.CalledProcessError as e:
        print(f"⚠️ Command failed: {e}")

# ----------------------------
# Step 1: Upgrade pip
# ----------------------------
print("🔹 Upgrading pip...")
run_cmd([sys.executable, "-m", "pip", "install", "--upgrade", "pip"])

# ----------------------------
# Step 2: Install dependencies
# ----------------------------
print("🔹 Installing required Python packages...")
if os.path.exists("requirements.txt"):
    run_cmd([sys.executable, "-m", "pip", "install", "-r", "requirements.txt"])
else:
    print("⚠️ requirements.txt not found! Make sure it is in the folder.")

# ----------------------------
# Step 3: Ensure JSON backups
# ----------------------------
for json_file in ["chat_logs.json", "memory_store.json"]:
    if not os.path.exists(json_file):
        with open(json_file, "w") as f:
            json.dump({}, f)
        print(f"✅ Created {json_file}")

# ----------------------------
# Step 4: Create optional folders
# ----------------------------
for folder in ["backend", "frontend"]:
    if not os.path.exists(folder):
        os.mkdir(folder)
        print(f"✅ Created folder {folder}")

# ----------------------------
# Step 5: Launch main.py
# ----------------------------
main_file = "main.py"
if not os.path.exists(main_file):
    print(f"⚠️ {main_file} not found! Make sure it's in the folder.")
else:
    print("✅ Setup complete! Launching NeuraAI v500...")

    # Optional prompt for premium & voice mode
    use_voice = input("Enable voice engine by default? (y/n): ").strip().lower() == "y"
    is_premium = input("Run in premium mode? (y/n): ").strip().lower() == "y"

    # Build launch command
    launch_cmd = f'{sys.executable} {main_file}'

    print("🔹 NeuraAI v500 is starting...")
    # Pass environment variables to main.py for premium & voice
    os.environ["NEURAAI_PREMIUM"] = "true" if is_premium else "false"
    os.environ["NEURAAI_VOICE"] = "true" if use_voice else "false"

    time.sleep(1)
    os.system(launch_cmd)