mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-12-01 01:05:30 +08:00
feat: 本地 API 支持按需转写语音消息
读取消息时返回本地已有的语音转写及其状态 新增 query/voice-transcribe 接口按 messageRef 转写指定语音
This commit is contained in:
1 parent
e5f0aa59f4
commit
4d9af4a193
11 files changed
+843
-14
No files matched your search
@@ -42,6 +42,7 @@ description: 通过 TraceMemo 本地 HTTP API 按需读取用户有权访问的
|
||||
| POST | `/query/search` | 受限语义关键词检索(依赖本地索引,见 freshness) |
|
||||
| POST | `/query/message-context` | 用 `messageRef` 取某条消息的前后文 |
|
||||
| POST | `/query/conversation-overview` | 按会话与时间范围提取可总结的证据 |
|
||||
| POST | `/query/voice-transcribe` | 把指定语音消息转成文字(本机离线识别) |
|
||||
| GET | `/query/capabilities` | Query 端点能力目录 |
|
||||
| GET | `/wechat-personal/send-capability` | 个人微信发送能力状态(文字 / 图片 / 语音) |
|
||||
| GET | `/scheduled-reports` | 查询全部定时日报任务 |
|
||||
@@ -118,6 +119,7 @@ description: 通过 TraceMemo 本地 HTTP API 按需读取用户有权访问的
|
||||
- `query/search`:受限语义关键词检索,依赖本地索引;
|
||||
- `query/message-context`:用返回的 `messageRef` 取前后文;
|
||||
- `query/conversation-overview`:按会话与时间范围提取可总结的证据。
|
||||
- `query/voice-transcribe`:把指定语音消息的 `messageRef` 转成文字。
|
||||
|
||||
两个要点:
|
||||
|
||||
@@ -147,6 +149,18 @@ description: 通过 TraceMemo 本地 HTTP API 按需读取用户有权访问的
|
||||
|
||||
不要只根据 `[图片]` 猜测内容,不要把一次 OCR 当作完整图片理解,也不要直接读取任意本地图片路径。
|
||||
|
||||
### 语音消息
|
||||
|
||||
语音消息的正文固定是 `[语音消息]`,转写结果在 `voiceTranscript`,状态在 `voiceTranscriptState`(`/chatlog` 与 `query/*` 都会返回)。
|
||||
|
||||
1. `transcribed`:直接使用 `voiceTranscript`。
|
||||
2. `pending`:还没转写,**不能**说成“语音里没内容”。回答需要它时,把这些语音的 `messageRef` 批量(每次最多 20 条)交给 `POST /query/voice-transcribe`。
|
||||
3. 返回 `pending`(`still_processing`)时,稍后用同样的 `messageRefs` 再调用一次;不要换参数反复重试。
|
||||
4. 返回 `failed` 时按 `hint` 处理;`previously_failed` 只有用户明确要求才传 `force: true` 重试。
|
||||
5. `503 voice_model_not_ready`:告诉用户先在 TraceMemo 设置中下载语音识别模型,在此之前不要重试。
|
||||
6. `429 busy`:等待 `retryAfterSeconds` 后再调用。
|
||||
7. 只转写回答问题所需的语音,不要一次把整个会话的语音都提交。
|
||||
|
||||
## 隐私和安全
|
||||
|
||||
只读取用户请求所需的会话和时间范围。不要把完整聊天数据库、密钥或 Token 暴露给用户。Reader API 本身不自动把聊天转发到外部服务器,但当前 Agent 可能会把工具结果交给其配置的模型;如有疑问,提醒用户检查 Agent 的数据策略。
|
||||
|
||||
Reference in new issue
Block a user