-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.ps1
More file actions
106 lines (91 loc) · 4.02 KB
/
Copy pathsetup.ps1
File metadata and controls
106 lines (91 loc) · 4.02 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# CadentialAI Setup Script
# Quick setup for development environment
param(
[switch]$InstallDeps,
[switch]$SetupDev,
[switch]$SetupConfig,
[switch]$RunTests
)
Write-Host "🤖 CadentialAI Setup Script" -ForegroundColor Cyan
Write-Host "================================" -ForegroundColor Cyan
# Check Python version
$pythonVersion = python --version 2>&1
if ($pythonVersion -match "Python (\d+\.\d+)") {
$version = [version]$matches[1]
if ($version -ge [version]"3.10") {
Write-Host "✅ Python $($matches[1]) found" -ForegroundColor Green
} else {
Write-Host "❌ Python 3.10+ required. Found: $($matches[1])" -ForegroundColor Red
exit 1
}
} else {
Write-Host "❌ Python not found. Please install Python 3.10+" -ForegroundColor Red
exit 1
}
if ($InstallDeps) {
Write-Host "📦 Installing dependencies..." -ForegroundColor Yellow
python -m pip install --upgrade pip
pip install -r requirements.txt
# Install UFO dependencies if UFO folder exists
if (Test-Path "UFO\requirements.txt") {
Write-Host "📦 Installing UFO dependencies..." -ForegroundColor Yellow
pip install -r UFO\requirements.txt
}
Write-Host "✅ Dependencies installed" -ForegroundColor Green
}
if ($SetupConfig) {
Write-Host "🔧 Setting up configuration..." -ForegroundColor Yellow
# Create main config.yaml from template
if (-not (Test-Path "config.yaml")) {
if (Test-Path "config.template.yaml") {
Copy-Item "config.template.yaml" "config.yaml"
Write-Host "📋 Created config.yaml from template" -ForegroundColor Green
} else {
Write-Host "❌ config.template.yaml not found" -ForegroundColor Red
}
} else {
Write-Host "📋 config.yaml already exists" -ForegroundColor Yellow
}
# Setup UFO config
if (Test-Path "UFO\config\config.yaml.template") {
if (-not (Test-Path "UFO\config\config.yaml")) {
Copy-Item "UFO\config\config.yaml.template" "UFO\config\config.yaml"
Write-Host "📋 Created UFO config.yaml from template" -ForegroundColor Green
} else {
Write-Host "📋 UFO config.yaml already exists" -ForegroundColor Yellow
}
}
Write-Host ""
Write-Host "⚠️ IMPORTANT: Please edit the following files with your API keys:" -ForegroundColor Yellow
Write-Host " - config.yaml (main CadentialAI config)" -ForegroundColor White
Write-Host " - UFO\config\config.yaml (UFO framework config)" -ForegroundColor White
Write-Host ""
}
if ($SetupDev) {
Write-Host "🔧 Setting up development environment..." -ForegroundColor Yellow
# Install development dependencies
pip install pytest pytest-cov black flake8
# Create virtual environment if it doesn't exist
if (-not (Test-Path "venv")) {
Write-Host "🌐 Creating virtual environment..." -ForegroundColor Yellow
python -m venv venv
}
Write-Host "✅ Development environment setup complete" -ForegroundColor Green
}
if ($RunTests) {
Write-Host "🧪 Running tests..." -ForegroundColor Yellow
python -m pytest tests/ -v
Write-Host "✅ Tests completed" -ForegroundColor Green
}
Write-Host ""
Write-Host "🚀 Setup completed! Next steps:" -ForegroundColor Cyan
Write-Host "1. Run: .\setup.ps1 -SetupConfig # Create config files" -ForegroundColor White
Write-Host "2. Edit config.yaml with your API keys" -ForegroundColor White
Write-Host "3. Edit UFO\config\config.yaml with your UFO settings" -ForegroundColor White
Write-Host "4. Run: python -m cadential_ai # Start the assistant" -ForegroundColor White
Write-Host ""
Write-Host "For help, run:" -ForegroundColor Gray
Write-Host " .\setup.ps1 -InstallDeps # Install dependencies" -ForegroundColor Gray
Write-Host " .\setup.ps1 -SetupConfig # Setup config files" -ForegroundColor Gray
Write-Host " .\setup.ps1 -SetupDev # Setup dev environment" -ForegroundColor Gray
Write-Host " .\setup.ps1 -RunTests # Run tests" -ForegroundColor Gray