|
|
@@ -72,6 +72,7 @@ RAG 索引使用进程内 **`InMemoryRagStore`**(按 `task_id` 隔离)。**
|
|
|
| GET | `/debug/embedding` | 探测 Embedding 连通性 |
|
|
|
| GET | `/debug/ocr` | 探测 OCR(需 query `image_url`) |
|
|
|
| POST | `/v1/outline/l1` | 一级大纲 |
|
|
|
+| POST | `/v1/outline/l2/batch` | 二级大纲批量(按 L1 结果逐章聚合) |
|
|
|
| POST | `/v1/outline/l2` | 二级 / 末级结构(单章) |
|
|
|
| POST | `/v1/section` | 单知识单元段落生成 |
|
|
|
| POST | `/v1/rag/ingest-files` | 上传文件 → 解析 → 分块 → 入库 |
|
|
|
@@ -214,7 +215,7 @@ RAG 索引使用进程内 **`InMemoryRagStore`**(按 `task_id` 隔离)。**
|
|
|
| `chapter_id` | string | 须与输入候选一致 |
|
|
|
| `chapter_name` | string | 须与输入候选一致 |
|
|
|
| `presentation_enum` | string | `S1` 独立呈现 / `S2` 不呈现 |
|
|
|
-| `paragraph_count_enum` | string | `P0`~`P4`;**`S2` 必须为 `P1`;`S1` 不可为 `P0`**(服务端校验) |
|
|
|
+| `paragraph_count_enum` | string | `P0`~`P4`;**`S2` 必须为 `P0`;`S1` 不可为 `P0`**(服务端校验) |
|
|
|
| `reason` | string | 判断理由 |
|
|
|
|
|
|
**业务校验**(非空 `chapter_candidates` 时,见 `skills/outline_l1/outline_l1.py`):
|
|
|
@@ -274,15 +275,45 @@ RAG 索引使用进程内 **`InMemoryRagStore`**(按 `task_id` 隔离)。**
|
|
|
| `source_candidate_name` | string / null | 候选名 |
|
|
|
| `is_selected` | boolean | 默认 `true` |
|
|
|
|
|
|
-**`chapter_presentation_enum = S2` 时的服务端约束**:
|
|
|
+**`chapter_presentation_enum = S2` 时的服务端行为**:
|
|
|
|
|
|
-- 解析成功后若 `chapter_structure` **非空**,抛出 `ValueError` → **422**
|
|
|
-- **Stub 模式**下对 `S2` 会直接返回 **空** `chapter_structure`
|
|
|
+- **非 stub**:**不调用 LLM**,直接返回 `chapter_structure: []`,避免模型偶发输出非空结构导致 422,并节省调用。
|
|
|
+- **Stub 模式**:同样返回空 `chapter_structure`。
|
|
|
+- **`S1`**:走模型 + JSON 校验;若返回的 `chapter_name` / `chapter_no` 与请求不一致等,仍可能 **422**。
|
|
|
|
|
|
**`FINREP_STUB_SKILLS=true`**:不请求 LLM;`S1` 返回占位节点,`S2` 返回空结构。
|
|
|
|
|
|
---
|
|
|
|
|
|
+### `POST /v1/outline/l2/batch`
|
|
|
+
|
|
|
+**Content-Type**:`application/json`
|
|
|
+
|
|
|
+按 **`l1_response.chapter_results` 的顺序**逐章调用与单章 L2 相同的技能(`run_outline_l2`),将 **`l1_task_snapshot`** 作为各章的 `l1_task_snapshot`。`chapter_no` 自动为 `1`、`2`、`3`…(与 L1 结果行序一致)。
|
|
|
+
|
|
|
+**请求体**:`OutlineL2BatchRequest`
|
|
|
+
|
|
|
+| 字段 | 类型 | 必填 | 说明 |
|
|
|
+|------|------|------|------|
|
|
|
+| `l1_task_snapshot` | object | 是 | 与调用 L1 时一致的 **`OutlineL1Request`** |
|
|
|
+| `l1_response` | object | 是 | L1 返回的 **`OutlineL1Response`**(含 `chapter_results`、`overall_logic`) |
|
|
|
+| `task_id` | string | 否 | 透传各章 `OutlineL2Request` |
|
|
|
+| `tenant_id` | string | 否 | 同上 |
|
|
|
+| `leaf_chapter_candidates_by_chapter_id` | object | 否 | 可选:键为 `chapter_id`,值为该章末级候选 `object[]`;未出现的 `chapter_id` 走模板内置末级分支 |
|
|
|
+
|
|
|
+**响应体**:`OutlineL2BatchResponse`
|
|
|
+
|
|
|
+| 字段 | 类型 | 说明 |
|
|
|
+|------|------|------|
|
|
|
+| `overall_logic` | string | 与 `l1_response.overall_logic` 一致 |
|
|
|
+| `chapters` | array | 与 L1 结果 **同序**;每项含 `chapter_id`、`chapter_name`、`presentation_enum`、`paragraph_count_enum`、`reason` 及嵌套的 **`l2`**(`OutlineL2Response`) |
|
|
|
+
|
|
|
+**说明**:章数较多或非 stub 时,总耗时会接近 **N 次单章 L2** 之和;超时可在网关或客户端按需要调大。
|
|
|
+
|
|
|
+**422**:同单章 L2(主要为 **`S1` 章**模型输出无法解析或与请求不一致等;`S2` 章不再因「结构非空」失败)。
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
## 8. 段落生成
|
|
|
|
|
|
### `POST /v1/section`
|