-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.ps1
More file actions
43 lines (37 loc) · 1.6 KB
/
Copy pathrun.ps1
File metadata and controls
43 lines (37 loc) · 1.6 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
# Coding Assistant Agent - one-click launcher
# Usage:
# .\run.ps1 # Streamlit UI (default)
# .\run.ps1 cli # interactive CLI
# .\run.ps1 cli "task..." # one-shot CLI
# .\run.ps1 api # FastAPI (uvicorn)
# .\run.ps1 demo # run the 5 master-prompt test cases
# .\run.ps1 test # pytest
# Reads GROQ_API_KEY from .env automatically (python-dotenv).
param(
[string]$Mode = "app",
[Parameter(ValueFromRemainingArguments = $true)]
[string[]]$Rest
)
$ErrorActionPreference = "Stop"
$env:PYTHONUTF8 = "1"
$env:MPLBACKEND = "Agg" # headless matplotlib (histogram case won't pop a window)
# Reuse the uc3_hybrid_rag venv (has langgraph + langchain-groq installed).
$py = "C:\Users\ACER\old_pc_data_bup\uc3_hybrid_rag\venv\Scripts\python.exe"
if (-not (Test-Path $py)) {
Write-Host "venv python not found at $py" -ForegroundColor Red
Write-Host "Make your own: python -m venv venv ; .\venv\Scripts\pip install -r requirements.txt" -ForegroundColor Yellow
exit 1
}
if (-not (Test-Path "$PSScriptRoot\.env")) {
Write-Host ".env not found. Run: Copy-Item .env.example .env then set GROQ_API_KEY" -ForegroundColor Red
exit 1
}
Set-Location $PSScriptRoot
switch ($Mode.ToLower()) {
"app" { & $py -m streamlit run app.py --server.fileWatcherType none }
"cli" { & $py cli.py @Rest }
"api" { & $py -m uvicorn api:app --reload }
"demo" { & $py scripts\demo.py @Rest }
"test" { & $py -m pytest -q }
default { Write-Host "Unknown mode '$Mode'. Use: app | cli | api | demo | test" -ForegroundColor Red; exit 1 }
}