Files
PlantAI-rag-new/agent/legacy-rag/api/app.py
T
jerryandClaude Fable 5 2f82c4a8dc P4/M5: agent/legacy-rag 源码迁移(449 模块 191K 行)+ 影子 7911/7912 冒烟
- 按生产 7900 容器黄金清单迁移(compile.manifest 449 条目,0 缺失)
- 入口双态:api.app(生产同源 3 路由)/ api.main(裁剪 11 路由族 91 路径)
- 修复:advanced/__init__ 空文件(包标记误覆盖,已从主项目恢复)
- 修复:api/rag_routes.py 跨环境 site-packages 注入改 LEGACY_GF_SITE_PACKAGES 门控
- 修复:scripts/utils 缺失(动态加载 reasoning_engine)
- 影子验证:kg/stats 数据连通(6.2s,与 7900 同源 normalized 后端)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-31 14:20:41 +08:00

36 lines
920 B
Python

"""Maintained FastAPI entrypoint for the PlantAI-rag cleanup baseline."""
from __future__ import annotations
from fastapi import FastAPI
from api.kg_routes import router as kg_router
from api.methodology_routes import router as methodology_router
def create_app() -> FastAPI:
app = FastAPI(
title="PlantAI-rag API",
description="Maintained API surface for the PlantAI-rag open-source cleanup baseline.",
version="0.1.0",
)
app.include_router(kg_router, prefix="/api/v1")
app.include_router(methodology_router, prefix="/api/v1")
@app.get("/")
async def root() -> dict[str, str]:
return {
"name": "PlantAI-rag",
"status": "ready",
"runtime_surface": "maintained_baseline",
}
@app.get("/health")
async def health() -> dict[str, str]:
return {"status": "healthy"}
return app
app = create_app()