#Requires -Version 5.1 # 知识库入库脚本:解析桌面知识库 → 向量化 → 存入 Milvus param([switch]$Rebuild) $ErrorActionPreference = "Stop" $Root = Split-Path (Split-Path $PSScriptRoot -Parent) -Parent Set-Location $Root Write-Host "=== 知识库入库 ===" -ForegroundColor Cyan python scripts/kb/build_collections.py $(if ($Rebuild) { "--rebuild" }) if ($LASTEXITCODE -ne 0) { Write-Host "入库失败!" -ForegroundColor Red exit 1 } Write-Host "=== 入库完成 ===" -ForegroundColor Green