Files
jerryandClaude Fable 5 28b497354e P3/M4: agent/methodology 源码导入(16K 行)+ 影子 8001 冒烟
- 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>
2026-08-31 13:47:12 +08:00

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),
}