优化文档与测试脚本

This commit is contained in:
lulijing
2026-03-23 20:26:13 +08:00
parent 3ddc2e1ff4
commit 2d50522e68
14 changed files with 654 additions and 188 deletions

View File

@@ -46,12 +46,24 @@ export ENABLE_THINKING=true
### 3. RAG 知识库灌入
首次使用或更新知识库后需执行灌入
**必须先启动 Embedding 服务**(默认 `http://localhost:8090/v1`)。灌入会向该地址请求向量;未启动会出现 `Connection refused`。可与 Chat 一并启动
```bash
python -m drone_planning.rag.ingestion
bash run_api.sh # 含 8081 Chat + 8090 Embedding待终端出现 listening 后再灌入
```
**包位于 `src/` 下**,灌入命令任选其一:
```bash
# 方式 A已执行 pip install -e . 时
python -m drone_planning.rag.ingestion
# 方式 B未安装包时需指定 PYTHONPATH与 run_api.sh 一致)
PYTHONPATH=src python -m drone_planning.rag.ingestion
```
Embedding 地址可通过环境变量覆盖:`export LLM_EMBEDDING_BASE_URL=http://主机:端口/v1`
知识库文件位于 `data/knowledge/`
- `map_db.jsonl`地点坐标location, x, y, z
@@ -60,8 +72,10 @@ python -m drone_planning.rag.ingestion
### 4. 启动 API 服务
项目根目录下需让 Python 能找到 `src/drone_planning`(已 `pip install -e .` 可省略):
```bash
python -m uvicorn main:app --reload --host 0.0.0.0 --port 8000
PYTHONPATH=src python -m uvicorn main:app --reload --host 0.0.0.0 --port 8000
```
### 5. 启动 Playground 测试台