refactor: 重构 algorithm 为 ai-core 代码解析服务
- 新增 ai-core 目录,包含代码解析核心服务 - 添加 proto 定义、parser、service 模块 - 添加启动脚本和依赖配置 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
35
ai-core/start.ps1
Normal file
35
ai-core/start.ps1
Normal file
@@ -0,0 +1,35 @@
|
||||
# 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
|
||||
Reference in New Issue
Block a user