Skip to content

[feat] providers: add Zhipu BigModel GLM-TTS and voice management (#238) - #276

Open
Zhangbo-cn wants to merge 1 commit into
ThinkFlowLab:mainfrom
Zhangbo-cn:feat/238-zhipu-glm-tts
Open

Zhangbo-cn wants to merge 1 commit into
ThinkFlowLab:mainfrom
Zhangbo-cn:feat/238-zhipu-glm-tts

Conversation

@Zhangbo-cn

@Zhangbo-cn Zhangbo-cn commented Nov 10, 2026 •

Copy link
Copy Markdown

Summary

  • Add Zhipu BigModel glm-tts as an audio provider on the existing connection-scoped voice library ([feat] audio: add a connection-scoped voice library with on-demand MOSS pagination #218): 7 documented preset voices plus the account's cloned voices. UI and agent tools share the same service for clone (upload → glm-tts-clone → delete sample → read back), select, synthesize and delete. Voice IDs are scoped to the provider connection.
  • Only non-streaming 24 kHz WAV is requested, and only a RIFF body is accepted. JSON errors that arrive with HTTP 200 fail the job. BigModel 1113 maps to quota and 1214 "音色不存在" maps to voice_not_found. Format and sample rate are recorded in the execution snapshot.
  • Text length (1024), recording type (mp3/wav), recording duration (3–30 s) and duplicate names are checked before any job or remote call is created.
  • Zhipu is also added as a conversation-agent preset (models from /models). When no conversation model is configured, the assistant footnote now explains why Send is disabled and links to settings.
  • The OFFICIAL voice list is not used: entries such as jam1 and streamer fail synthesis on the live API.

Linked issue

Labels

  • Suggested: type:feat, area:provider, area:canvas, modality:audio. I can't apply labels from a fork.

Test plan

  • Local:
    • pytest: 1611 passed, 98 skipped (includes 31 new tests in tests/test_zhipu.py).
    • npm test: 757 passed.
    • npm run check:i18n, npm run check:browser-manifest, npm run build and tsc --noEmit are clean.
    • tests/browser/zhipu_real.mjs passed against the real service in both locales. This script is a paid manifest helper and is not run in any lane.
  • Left to CI: Release checks.

Evidence that it works

  • Media attached
zh-CN en-US
Preset library
Preset narration result
Clone form
Cloned voice selected and synthesized
Delete confirmation
After delete
No conversation model: hint
Zhipu agent models fetched

Provider verification

  • Real-provider calls are described honestly
  • Real BigModel API (open.bigmodel.cn/api/paas/v4) with a funded key, run on 2026-11-10:
    • Preset narration (tongtong) and the full clone lifecycle (upload, create, select, synthesize, preview, delete) passed in both locales. Afterwards the account had no PRIVATE voices and no files.
    • /models discovery listed the GLM models. Agent connection tests succeeded with glm-4.5-flash and glm-5.3-flash.
    • In a manual agent run, glm-5.3-flash produced xiaochen narration through generation submit.
  • Covered by mocked protocol tests only: error-code mapping (1000/1113/1214), HTTP-200 JSON errors, the non-RIFF body guard, and the preview-URL HTTPS guard.
  • Not verified:
    • Similarity of the cloned voice. This needs a human listening check.
    • The AIGC WAV metadata chunk. BigModel always embeds it unless de-watermarking is enabled in the console, and it cannot be controlled from code.
  • Known limits:
    • Two model configs that share one key count as separate connections. This is unchanged shared behavior.
    • BigModel keeps the clone-output preview file after a voice is deleted.

Bilingual UI

  • zh-CN and en-US updated together, and both user guides are updated.

…inkFlowLab#238)

## summary

- Add `glm-tts` as an audio provider through the existing connection-scoped
  voice library: 7 documented preset voices plus the account's cloned voices,
  with clone (upload → `glm-tts-clone` → delete sample → read back), select,
  synthesize and delete available to both the UI and the agent tools.
- Request non-streaming 24 kHz WAV and accept only RIFF bodies; JSON errors
  returned with HTTP 200 fail the job. Map BigModel 1113 to quota and 1214
  "voice not found" to `voice_not_found`; record format and sample rate in the
  execution snapshot.
- Validate text length (1024), recording type (mp3/wav), 3–30 s duration and
  duplicate names before any job or remote call is created.
- Add Zhipu as a conversation-agent preset (models discovered via `/models`)
  and explain a disabled send button when no conversation model is configured.
- Add zh-CN/en-US messages and user-guide sections.

## validation

- `pytest`: 1611 passed, 98 skipped; `npm test`: 757 passed.
- `check:i18n`, `check:browser-manifest`, `build`, `tsc --noEmit`: clean.
- `tests/browser/zhipu_real.mjs` (manifest helper, paid) against the real
  BigModel API in zh-CN and en-US: preset narration and the full clone
  lifecycle passed; the account was left with no cloned voices or files.
@FayeSpica FayeSpica added type:feat New capability or behaviour area:provider Model providers and generation protocols area:canvas Canvas, nodes and direct manipulation area:agent Agent runtime, assistant chat and tools modality:audio Speech, music or audio processing labels Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:agent Agent runtime, assistant chat and tools area:canvas Canvas, nodes and direct manipulation area:provider Model providers and generation protocols modality:audio Speech, music or audio processing type:feat New capability or behaviour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat] providers: add Zhipu BigModel GLM-TTS and voice management

2 participants