-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcadential_ai.py
More file actions
81 lines (67 loc) · 2.57 KB
/
Copy pathcadential_ai.py
File metadata and controls
81 lines (67 loc) · 2.57 KB
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
76
77
78
79
80
81
"""
CadentialAI Main Launcher
Entry point for the personal AI assistant
"""
import sys
import os
from pathlib import Path
# Add project root to Python path
project_root = Path(__file__).parent
sys.path.insert(0, str(project_root))
def main():
"""Main entry point for CadentialAI."""
try:
# Import configuration manager
from config_manager import config_manager
print("🤖 CadentialAI - Personal Windows AI Assistant")
print("=" * 50)
# Load configuration
try:
config = config_manager.load_config()
user_settings = config_manager.get_user_settings()
print(f"👋 Hello, {user_settings.get('USER_NAME', 'User')}!")
except Exception as e:
print(f"⚠️ Configuration error: {e}")
print("Please run: .\\setup.ps1 -SetupConfig")
return 1
# Check if UFO is available
ufo_path = project_root / "UFO"
if not ufo_path.exists():
print("❌ UFO framework not found!")
print("Please ensure the UFO folder is present in your project directory.")
return 1
# Import and start UFO
print("🚀 Starting UFO framework...")
try:
# Save current directory
original_dir = os.getcwd()
# Change to UFO directory
os.chdir(str(ufo_path))
# Run UFO as a module (this is the correct way)
import subprocess
print("✅ UFO framework loading...")
print("🎯 CadentialAI is ready to assist you!")
print("💡 Type your commands or say 'help' for available actions.")
print("📝 Starting UFO interface...")
# Run UFO using python -m ufo
result = subprocess.run([sys.executable, "-m", "ufo"], cwd=str(ufo_path))
return result.returncode
except Exception as e:
print(f"❌ Error starting UFO: {e}")
print("Please ensure UFO dependencies are installed:")
print(" pip install -r UFO/requirements.txt")
return 1
finally:
# Restore original directory
try:
os.chdir(original_dir)
except:
pass
except KeyboardInterrupt:
print("\n👋 CadentialAI shutting down. Goodbye!")
return 0
except Exception as e:
print(f"❌ Unexpected error: {e}")
return 1
if __name__ == "__main__":
sys.exit(main())