1+ # Check environment variables
2+ Write-Host " Checking environment variables..." - ForegroundColor Cyan
3+
4+ $openaiKeyMissing = $false
5+ $anthropicKeyMissing = $false
6+
7+ # Check OPENAI_API_KEY
8+ if (-not $env: OPENAI_API_KEY ) {
9+ Write-Host " OPENAI_API_KEY environment variable is not set" - ForegroundColor Yellow
10+ Write-Host " OpenAI models will not be available"
11+ Write-Host " Get an API key at https://platform.openai.com/api-keys"
12+ Write-Host " Please set it with: `$ env:OPENAI_API_KEY='your_api_key'" - ForegroundColor Green
13+ $openaiKeyMissing = $true
14+ } else {
15+ Write-Host " OPENAI_API_KEY set: OpenAI models are available" - ForegroundColor Green
16+ }
17+
18+ # Check ANTHROPIC_API_KEY
19+ if (-not $env: ANTHROPIC_API_KEY ) {
20+ Write-Host " ANTHROPIC_API_KEY environment variable is not set" - ForegroundColor Yellow
21+ Write-Host " Claude models will not be available"
22+ Write-Host " Get an API key at https://www.anthropic.com/api"
23+ Write-Host " Please set it with: `$ env:ANTHROPIC_API_KEY='your_api_key'" - ForegroundColor Green
24+ $anthropicKeyMissing = $true
25+ } else {
26+ Write-Host " ANTHROPIC_API_KEY set: Claude models are available" - ForegroundColor Green
27+ }
28+
29+ # Check if at least one API key is present
30+ if ($openaiKeyMissing -and $anthropicKeyMissing ) {
31+ Write-Host " ERROR: Both OPENAI_API_KEY and ANTHROPIC_API_KEY are missing." - ForegroundColor Red
32+ Write-Host " At least one API key is required to use language models." - ForegroundColor Red
33+ Write-Host " Please set at least one of these keys before running the application." - ForegroundColor Red
34+ exit 1
35+ }
36+
37+ Write-Host " Environment check completed successfully." - ForegroundColor Green
38+
39+ exit 0 # Explicitly exit with success code
0 commit comments