更新了skill
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -40,9 +40,9 @@ function Get-StoredPid {
|
||||
}
|
||||
|
||||
function Test-ServerRunning {
|
||||
$pid = Get-StoredPid
|
||||
if ($pid -eq 0) { return $false }
|
||||
$proc = Get-Process -Id $pid -ErrorAction SilentlyContinue
|
||||
$storedPid = Get-StoredPid
|
||||
if ($storedPid -eq 0) { return $false }
|
||||
$proc = Get-Process -Id $storedPid -ErrorAction SilentlyContinue
|
||||
if (-not $proc) { return $false }
|
||||
return (Test-HttpOk "$ApiUrl/ok")
|
||||
}
|
||||
@@ -107,8 +107,8 @@ switch ($Command) {
|
||||
|
||||
"start" {
|
||||
if (Test-ServerRunning) {
|
||||
$pid = Get-StoredPid
|
||||
Write-Host "[dev-server] Already running (PID $pid) at $ApiUrl"
|
||||
$storedPid = Get-StoredPid
|
||||
Write-Host "[dev-server] Already running (PID $storedPid) at $ApiUrl"
|
||||
Write-Host "[dev-server] Studio: https://smith.langchain.com/studio/?baseUrl=$ApiUrl"
|
||||
exit 0
|
||||
}
|
||||
@@ -122,6 +122,10 @@ switch ($Command) {
|
||||
Remove-Item $StdoutLog -ErrorAction SilentlyContinue
|
||||
Remove-Item $StderrLog -ErrorAction SilentlyContinue
|
||||
|
||||
# Force UTF-8 to avoid GBK decode errors on Chinese Windows systems
|
||||
$env:PYTHONUTF8 = "1"
|
||||
$env:PYTHONIOENCODING = "utf-8"
|
||||
|
||||
$proc = Start-Process -FilePath $lgExe `
|
||||
-ArgumentList "dev", "--no-browser" `
|
||||
-WorkingDirectory $SkillDir `
|
||||
@@ -167,9 +171,9 @@ switch ($Command) {
|
||||
}
|
||||
|
||||
"stop" {
|
||||
$pid = Get-StoredPid
|
||||
if ((Stop-ServerProcess -PidValue $pid)) {
|
||||
Write-Host "[dev-server] Stopped (PID $pid)"
|
||||
$storedPid = Get-StoredPid
|
||||
if ((Stop-ServerProcess -PidValue $storedPid)) {
|
||||
Write-Host "[dev-server] Stopped (PID $storedPid)"
|
||||
} else {
|
||||
Write-Host "[dev-server] Not running (nothing to stop)"
|
||||
}
|
||||
@@ -178,8 +182,8 @@ switch ($Command) {
|
||||
|
||||
"status" {
|
||||
if (Test-ServerRunning) {
|
||||
$pid = Get-StoredPid
|
||||
Write-Host "[dev-server] Running (PID $pid) at $ApiUrl"
|
||||
$storedPid = Get-StoredPid
|
||||
Write-Host "[dev-server] Running (PID $storedPid) at $ApiUrl"
|
||||
Write-Host "[dev-server] Studio: https://smith.langchain.com/studio/?baseUrl=$ApiUrl"
|
||||
} else {
|
||||
Write-Host "[dev-server] Not running"
|
||||
|
||||
Reference in New Issue
Block a user