Skip to content

fix: send speech keyterms as repeated fields - #820

Open
Sanjays2402 wants to merge 1 commit into
elevenlabs:mainfrom
Sanjays2402:fix/repeated-stt-keyterms
Open

fix: send speech keyterms as repeated fields#820
Sanjays2402 wants to merge 1 commit into
elevenlabs:mainfrom
Sanjays2402:fix/repeated-stt-keyterms

Conversation

@Sanjays2402

@Sanjays2402 Sanjays2402 commented Jul 24, 2026

Copy link
Copy Markdown

Closes #819

The v2.59 client JSON-encodes keyterms into one multipart field, causing the API to apply its per-term length limit to the entire array. The hand-maintained speech-to-text wrapper now routes keyterms through repeated multipart fields without modifying Fern-generated files, for both sync and async clients.

Regression tests inspect the multipart request body for both clients.


Note

Low Risk
Localized request-shaping fix in the custom STT wrapper with tests; no auth or core infrastructure changes.

Overview
Fixes speech-to-text keyterms encoding so the API receives one multipart field per term instead of a single JSON-encoded array (which incorrectly applied per-term length limits to the whole list).

The hand-maintained speech_to_text_custom wrapper adds _prepare_keyterms, which strips keyterms from the generated convert call and injects them via request_options.additional_body_parameters. Sync and async convert overrides both use this path without touching Fern-generated code.

New httpx mock tests assert the outbound body has two name="keyterms" parts and does not contain a JSON array string.

Reviewed by Cursor Bugbot for commit c877f1e. Bugbot is set up for automated code reviews on this repo. Configure here.

Speech-to-text keyterms were JSON-encoded into one multipart field, so the API applied its per-term length limit to the entire array. Route keyterms through repeated multipart fields and cover both sync and async clients.
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.

keyterms parameter causes invalid_keyword_length error in v2.59.0 due to json.dumps() serialization regression

1 participant