Add speech voice clone and design commands - #221
Conversation
NianJiuZst
left a comment
There was a problem hiding this comment.
Thanks for adding voice cloning and voice design support. I do not recommend merging this PR in its current form because the new CLI and SDK contracts do not match the official MiniMax APIs.
The main blockers are:
-
Voice Design requires both
promptandpreview_text.voice_idis optional, but this implementation makes it required and never sendspreview_text, so real design requests can fail with an invalid-input response. Please addpreview_textto the CLI, SDK type, validation, and tests, and makevoice_idoptional. See the Voice Design API. -
Voice Clone and Voice Design have different response shapes and should not share
VoiceResponse. The clone endpoint does not returnvoice_id; it returns fields such asinput_sensitive,demo_audio,extra_info, andbase_resp. As written,speech clone --quietprintsundefined, while the SDK exposes an incorrect clone response type. Conversely, the design response includestrial_audio, which is missing from the current type. See the Voice Clone API. -
The SDK rejects clone requests without
model, although the official contract only requiresfile_idandvoice_id;modelis required only when previewtextis provided. The current request type does not exposetextat all. -
Please also align
file_idserialization with the documentedinteger<int64>schema. The direct--file-idpath currently sends a JSON string, and the tests assert string IDs rather than the provider's documented request shape.
I applied the commit to the latest main: lint, typecheck, build, the focused tests (26/26), and the full suite (459/459) all pass. However, the new tests use mocks that mirror the same incorrect request and response shapes, so they do not validate compatibility with the real API.
Please split the endpoint-specific request/response types and update the mocks from the official schemas. Until the design request and clone response issues are fixed, this PR should not be merged.
Reason: Add voice cloning and voice design support to the speech CLI and SDK.
Changes:
Checks:
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.