Skip to content

feat: transcribe QQ voice messages to text via GLM-ASR#57

Merged
quick-sort merged 1 commit into
mainfrom
feat/qq-voice-asr-glm
Jun 17, 2026
Merged

feat: transcribe QQ voice messages to text via GLM-ASR#57
quick-sort merged 1 commit into
mainfrom
feat/qq-voice-asr-glm

Conversation

@hilr

@hilr hilr commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add voice-to-text for QQ channel audio attachments using GLM-ASR-2512 (ZhipuAI). When GLM_API_KEY is configured, audio attachments are transcribed in the channel layer before being forwarded to the router/agent, so the agent receives the spoken content ("用户发送了一段语音,内容: {text}") instead of just a file path.
  • When GLM_API_KEY is empty, behavior is unchanged — voice attachments fall back to the file-path-only description.
  • New src/agent_box/asr/glm.py client (reuses existing httpx, no new deps). Transcription failures degrade gracefully to None (rendered as the file path), never blocking the message flow.

Test Plan

  • tests/test_asr.py — 6 tests: success (request shape verified), HTTP error, empty text, network error, missing file, empty file
  • tests/test_channels.py — 8 tests: _atts_text with/without transcription, mixed attachments, _download_atts transcribes audio / skips when ASR disabled / falls back on failure / ignores non-audio, _asr enable/disable based on key
  • uv run pytest tests/test_asr.py tests/test_channels.py — 42 passed
  • uv run ruff check on changed files — clean

Closes #56

Add voice-to-text for QQ channel audio attachments. When GLM_API_KEY is
configured, audio attachments are transcribed with GLM-ASR-2512 before
being forwarded to the router/agent, so the agent receives the spoken
content instead of just a file path. Unconfigured, behavior is unchanged.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@quick-sort
quick-sort merged commit 3e9252d into main Jun 17, 2026
1 check passed
@quick-sort
quick-sort deleted the feat/qq-voice-asr-glm branch June 17, 2026 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: QQ channel 语音转文字(GLM-ASR)

2 participants