diff --git a/run_python_with_restart.ps1 b/run_python_with_restart.ps1 index 1f7625f..f3edc03 100644 --- a/run_python_with_restart.ps1 +++ b/run_python_with_restart.ps1 @@ -1,6 +1,7 @@ param( [Parameter(Mandatory=$true)] - [string]$PythonFile + [ValidateSet("Claude", "OpenAI")] + [string]$Model ) function Run-PythonScript { @@ -19,6 +20,12 @@ function Git-Pull { return $LASTEXITCODE -eq 0 } +if ($Model -eq "Claude") { + New-Item -ItemType File -Path ".reboot_claude" -Force +} elseif ($Model -eq "OpenAI") { + New-Item -ItemType File -Path ".reboot_openai" -Force +} + $waitTime = 30 while ($true) { python -m pip install -r requirements.txt @@ -32,8 +39,16 @@ while ($true) { continue } + $scriptPath = ".\chatgpt_telegram_inference_bot.py" # Default to ChatGPT + Remove-Item -Path ".\.reboot_openai" -Force + + if (Test-Path -Path ".\.reboot_claude") { # But if both are specified, choose Claude + $scriptPath = ".\anthropic_telegram_inference_bot.py" + Remove-Item -Path ".\.reboot_claude" -Force + } + Write-Host "Tests passed. Starting main Python script..." - $exitCode = Run-PythonScript -ScriptPath $PythonFile + $exitCode = Run-PythonScript -ScriptPath $scriptPath if (Test-Path -Path ".\.doreboot") { Write-Host "Special filename detected. Attempting git pull..."