File size: 977 Bytes
5862322
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
$ErrorActionPreference = "Stop"

$root = Split-Path -Parent $PSScriptRoot
$dataDir = Join-Path $root "data"
$envPath = Join-Path $root ".env"

New-Item -ItemType Directory -Force -Path $dataDir | Out-Null

$secureKey = Read-Host "Together API key" -AsSecureString
$bstr = [Runtime.InteropServices.Marshal]::SecureStringToBSTR($secureKey)
try {
    $plainKey = [Runtime.InteropServices.Marshal]::PtrToStringBSTR($bstr)
}
finally {
    [Runtime.InteropServices.Marshal]::ZeroFreeBSTR($bstr)
}

if ([string]::IsNullOrWhiteSpace($plainKey)) {
    throw "Together API key cannot be empty."
}

@(
    "# Local development secrets for AI Time Machine."
    "# This file is ignored by git via data/*."
    "TIME_MACHINE_ADAPTER_PROFILE=dev"
    "TIME_MACHINE_LLM_API_KEY=$plainKey"
    "TIME_MACHINE_LLM_MODEL=Qwen/Qwen2.5-7B-Instruct-Turbo"
) | Set-Content -Path $envPath -Encoding UTF8

Write-Host "Wrote $envPath"
Write-Host "Next: .\.venv\Scripts\python.exe scripts\walk_smoke.py"