feat/ eval
This commit is contained in:
@@ -55,6 +55,39 @@ VITE_EVAL_API_BASE=http://127.0.0.1:8001 VITE_EVAL_API_KEY=与上同 npm run dev
|
||||
|
||||
浏览器 `EventSource` 无法带自定义 Header,流式端点支持 **query** `?key=`,与 `X-Internal-Eval-Key` 等效。
|
||||
|
||||
## 评测 Web:两大模块
|
||||
|
||||
- **对话评测**:选 `api/tests/user_exports/*.md` 为基准 →「新建评测会话」或填写已有 `conversation_id` →「执行回放」→「GLM 评审对话」。
|
||||
- **回忆录章节**:同一套 fixture 会带上导出 MD 中的 `source_user_id` 与 `memoir_sections`;「刷新库中章节/故事」拉 DB 快照 →「GLM 评审章节」(基线节选与当前成稿一并送评)。
|
||||
|
||||
## 真实链路透传回放(与 App 一致)
|
||||
|
||||
| 方法 | 路径 | 说明 |
|
||||
|------|------|------|
|
||||
| `POST` | `/internal/api/evaluation/sessions/eval-sandbox` | 无 body:新建**临时用户**(`eval_` 伪手机号)+ 空白 `conversation_id` |
|
||||
| `POST` | `/internal/api/evaluation/sessions/replay-bootstrap` | body:`{ "user_id" }`,在已有用户下返回新 `conversation_id` |
|
||||
| `POST` | `/internal/api/evaluation/replay/conversation` | body:`conversation_id`、`fixture_filename` **或** `user_utterances`;可选 `flush_memoir_after`(默认 true)、`skip_tts`(默认 true) |
|
||||
|
||||
每轮等价于 WebSocket 文本路径:`create_user_segment` → `process_user_message`(内部可 `force_skip_tts`)→ `background_runner.queue_message`。
|
||||
|
||||
- **TTS**:回放默认 `skip_tts: true`,不在评测台跑语音合成。
|
||||
- **Memory / 回忆录管线**:`queue_message` 与末尾 `flush_pending` 依赖 **Celery worker**(`process_memoir_phase1` 等);仅起 internal API 未起 worker 时,对话会落库但章节异步不会推进。
|
||||
|
||||
## 手动 GLM(不写 `eval_runs` 表)
|
||||
|
||||
| 方法 | 路径 | 说明 |
|
||||
|------|------|------|
|
||||
| `POST` | `/internal/api/evaluation/judge/conversation` | body:`{ "conversation_id" }`,返回轮次分 + 全文对话分 |
|
||||
| `POST` | `/internal/api/evaluation/judge/memoir-chapters` | body:`{ "user_id", "baseline_sections"? }`,Chapter/Story 分项 |
|
||||
| `GET` | `/internal/api/evaluation/users/{user_id}/memoir-snapshot` | 只读章节与故事正文快照 |
|
||||
|
||||
## Fixture 详情扩展
|
||||
|
||||
`GET /internal/api/evaluation/fixtures/user-exports/{filename}` 在原有 `turns` 外增加:
|
||||
|
||||
- `source_user_id`:导出抬头中的 User ID
|
||||
- `memoir_sections`:`## 回忆录章节(生成正文)` 下按标题切分的基线正文(已去掉 `{{IMAGE:...}}` 占位)
|
||||
|
||||
## 门禁规则(v1)
|
||||
|
||||
- 所有 case 的合成均分:候选须 **严格高于** 基线。
|
||||
|
||||
Reference in New Issue
Block a user