- src/rag/{unified(21模块),extractors/methodology,project_config} + api/methodology_routes.py(998行)
- 新薄入口 scripts/methodology_server.py(/health + /api/v1/methodology/*)
- env 化补丁:UPLOAD_JOBS_DIR/UPLOAD_OUTPUT_ROOT 支持 env 覆盖(数据根迁移免改代码)
- 影子 8001 冒烟:job 列表与生产 8000 完全一致(3/3)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
33 lines
1006 B
Python
Executable File
33 lines
1006 B
Python
Executable File
#!/usr/bin/env python3
|
|
"""agent/methodology 薄入口 —— Methodology 提取 API(挂 methodology_routes 于 /api/v1 + /health)。
|
|
|
|
与生产宿主进程(uvicorn api.main:app)等价的最小面:
|
|
- GET /health —— 健康(供 SDK upstream 探测)
|
|
- /api/v1/methodology/* —— 全量路由族(与 api/methodology_routes.py 契约一致)
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
import os
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
PROJECT_ROOT = Path(os.environ.get("PLANTAI_RAG_ROOT", Path(__file__).resolve().parents[1]))
|
|
if str(PROJECT_ROOT) not in sys.path:
|
|
sys.path.insert(0, str(PROJECT_ROOT))
|
|
|
|
from fastapi import FastAPI # noqa: E402
|
|
|
|
from api.methodology_routes import router as methodology_router # noqa: E402
|
|
|
|
app = FastAPI(title="PlantAI Methodology API", version="2.0.0")
|
|
app.include_router(methodology_router, prefix="/api/v1")
|
|
|
|
|
|
@app.get("/health")
|
|
def health():
|
|
return {
|
|
"status": "healthy",
|
|
"service": "methodology",
|
|
"project_root": str(PROJECT_ROOT),
|
|
}
|