Files
X-Agents/ai-core/start.ps1
DESKTOP-72TV0V4\caoxiaozhu 797518ec76 refactor: 重构 algorithm 为 ai-core 代码解析服务
- 新增 ai-core 目录,包含代码解析核心服务
- 添加 proto 定义、parser、service 模块
- 添加启动脚本和依赖配置

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 10:27:08 +08:00

36 lines
1.1 KiB
PowerShell

# AI-Core gRPC Server Startup Script
Write-Host "Starting AI-Core Document Parser gRPC Server..." -ForegroundColor Green
# Check if Python is installed
if (-not (Get-Command python -ErrorAction SilentlyContinue)) {
Write-Host "Error: Python is not installed or not in PATH" -ForegroundColor Red
exit 1
}
# Check if requirements are installed
$requirementsInstalled = python -c "import grpcio" 2>$null
if (-not $?) {
Write-Host "Installing Python dependencies..." -ForegroundColor Yellow
pip install -r requirements.txt
if ($LASTEXITCODE -ne 0) {
Write-Host "Error: Failed to install dependencies" -ForegroundColor Red
exit 1
}
}
# Generate gRPC code if needed
$pb2File = "proto\document_parser_pb2.py"
if (-not (Test-Path $pb2File)) {
Write-Host "Generating gRPC code..." -ForegroundColor Yellow
python generate_grpc.py
if ($LASTEXITCODE -ne 0) {
Write-Host "Error: Failed to generate gRPC code" -ForegroundColor Red
exit 1
}
}
# Start the server
Write-Host "Starting server on port 50051..." -ForegroundColor Green
python main.py --port 50051 --max-workers 10 --log-level INFO