Skip to content

fix(gmicloud): alias prompt to text/lyrics for GMI audio models - #265

Open
jeronimodeleon wants to merge 1 commit into
mainfrom
fix/issue-251-gmi-audio-param-alias
Open

fix(gmicloud): alias prompt to text/lyrics for GMI audio models#265
jeronimodeleon wants to merge 1 commit into
mainfrom
fix/issue-251-gmi-audio-param-alias

Conversation

@jeronimodeleon

Copy link
Copy Markdown
Contributor

Summary

Every GMI Cloud audio model (TTS and music) via genblaze-gmicloud's GMICloudAudioProvider was unreachable — every request 400'd with "Required parameter is missing" because the SDK's own param allowlist stripped the API's required text (TTS) / lyrics (music) fields before the request went out, and there was no alias from the canonical prompt param (the one every other modality uses) onto them.

Changes

  • libs/connectors/gmicloud/genblaze_gmicloud/models/audio.py: added a _TTS ParamSurface (_AUDIO_BASE.with_aliases(prompt="text")) used by the gmi-audio-tts family, and chained .with_aliases(prompt="lyrics") onto _MUSIC for the gmi-audio-music family. with_aliases() auto-adds the alias target to the allowlist, so text/lyrics are no longer stripped. Updated the module docstring to match.
  • libs/connectors/gmicloud/tests/test_catalog_decoupling.py: registry-level regression tests confirming text/lyrics are allow-listed and aliased from prompt for the TTS/music families.
  • libs/connectors/gmicloud/tests/test_gmicloud_audio_provider.py: end-to-end regression tests confirming prompt= reaches prepare_payload() and the outgoing HTTP body as text (TTS) / lyrics (music), with prompt itself absent from the final payload.
  • docs/reference/model-matrix.md: updated the affected rows' "Allowed params" column (this file is generator-owned by tools/gen_model_matrix.py; hand-patched here to match exactly what the generator would emit, since this sandbox lacks the API-key env vars the generator needs to enumerate every connector without wiping unrelated sections).
  • CHANGELOG.md: [Unreleased] entry under ### genblaze-gmicloud.

Deliberately out of scope: the gmi-audio-clone (MiniMax Voice-Clone) family was left untouched. The issue's own root-cause analysis and suggested fix are scoped to gmi-audio-tts/gmi-audio-music only (its title literally says "the TTS/music param allowlists"); voice-clone was mentioned in the issue's affected-models table without a reproduced failure. Rather than guess at an unconfirmed payload contract, I filed a scoped follow-up: #257.

Test plan

  • make test passes (verified this session — full suite, 19 packages, 0 failures)
  • make lint passes for the touched connector (ruff check/ruff format --check libs/connectors/gmicloud/)
  • Docs updated in this PR (CHANGELOG + model-matrix.md)
  • make typecheck — not run this session (scoped to libs/core, unaffected by this change; connector typecheck is optional per the release-check gate)

New regression tests (test_catalog_decoupling.py, test_gmicloud_audio_provider.py) were confirmed to fail against the pre-fix code (KeyError: 'text'/'lyrics') and pass after the fix, per TDD.

This PR went through a triangulated 3-lens review (correctness/tests, security/invariants, architecture/DRY) against the committed diff before push:

  • Correctness: no P0s. One P1 — flagged that gmi-audio-clone may share the same defect but wasn't in the issue's confirmed reproduction; resolved by filing Confirm whether gmi-audio-clone (MiniMax Voice-Clone) also needs a prompt->text alias #257 rather than shipping an unverified alias.
  • Security: no blocking issues. Two informational P2s (pre-existing shared alias-collision logging behavior in model_registry.py, and the same clone-family scoping note) — not regressions from this diff.
  • Architecture/DRY: no blocking issues. Confirmed the ParamSurface.with_aliases() per-family composition here matches the existing video.py convention (e.g. _VIDEO_BASE/_PIXVERSE), adds zero per-request overhead, and is appropriately minimal.

Related

Refs #251 (intentionally not using a closing keyword — see the "Deliberately out of scope" note above; leaving the issue's closure to a maintainer's judgment call given the voice-clone open question)
Refs #257 (follow-up: confirm whether gmi-audio-clone needs the same aliasing)

GMI Cloud's TTS endpoint requires a `text` payload field and its music
endpoint requires `lyrics`, but the SDK's param allowlist only ever
carried `prompt` for those families, so every audio submit 400'd with
"Required parameter is missing" before reaching GMI. Alias `prompt` to
`text`/`lyrics` per family so audio steps take the same `prompt=` every
other modality already uses, and add it to the allowlist so it isn't
stripped.

Voice-clone (`gmi-audio-clone`) is untouched -- its own family surface,
and out of the reproduced scope in #251.
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.

1 participant