chore: retire legacy wolai backend runtime

This commit is contained in:
lix-2026
2026-05-28 22:02:10 +08:00
parent 39b9a0183a
commit 1109e3c0d8
31 changed files with 21 additions and 5785 deletions
+9 -25
View File
@@ -1,10 +1,12 @@
# wolai-backendstage0 骨架)
# wolai-backend
本目录是 design3.0 指南下的 FastAPI + Celery 阶段 0 脚手架。当前目标:
本目录现在只保留轻量 FastAPI 辅助后端。OpenAI Agents 文档代理、Celery/Redis 队列和旧 OCR 占位链路已退役到仓库 `recycle/`,当前 AI 主链统一走 Hermes / Reasonix。
1. 暴露健康检查与占位 API`/api/v1/tasks/ocr``/api/v1/chat`),供前端联调。
2. 预留 Celery 队列、LightRAG、MinerU 集成点,但将重计算逻辑延后到阶段 1。
3. 依赖全部维护在 `requirements.txt`,其中 LightRAG 与 MinerU 通过本地源码安装,使用项目根目录已经下载好的仓库。
当前保留:
1. 健康检查:`GET /health`
2. CORS 配置:读取仓库根目录 `.env.all` 与环境变量
3. 依赖列表:`requirements.txt`
## 环境初始化
@@ -18,7 +20,7 @@ python -m venv venv
# set ALL_PROXY=
# set NO_PROXY=*
# 安装 PyPI 依赖 + 本地 LightRAG (项目根目录已放置源码)
# 安装 PyPI 依赖
pip install -r requirements.txt
```
@@ -29,31 +31,13 @@ pip install -r requirements.txt
```powershell
# FastAPI
uvicorn app.main:app --reload --port 8000
# Celery worker(后续阶段会真正处理 MinerU / LightRAG 作业)
celery -A app.workers.celery_app worker --loglevel=info
```
## 目录速览
```
app/
├── config.py # Pydantic 设置,统一读取 .env
├── deps.py # Supabase JWT / 客户端依赖
├── config.py # Pydantic 设置,统一读取仓库根目录 .env.all
├── routers/
│ ├── health.py # GET /health
│ ├── tasks.py # POST /api/v1/tasks/ocr、GET /api/v1/tasks/{id}
│ └── chat.py # GET /api/v1/chatSSE 占位)
├── schemas/ # Pydantic 请求/响应模型
├── services/ # LightRAG、MinerU、Storage 等服务占位
└── workers/
├── celery_app.py # Celery 配置
└── tasks.py # 后台任务入口(当前返回占位日志)
```
阶段 0 完成后,stage1 将在此基础上补充:
- MinerU OCR 实装(下载 Supabase Storage 文件 → 解析 → 更新 `documents`
- LightRAG 的增量索引 / 查询
- SSE 流式回答 + 来源引用
- Redis/APScheduler 任务状态回传