fix: send speech keyterms as repeated fields - #820
Open
Sanjays2402 wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #819
The v2.59 client JSON-encodes
keytermsinto 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
keytermsencoding 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_customwrapper adds_prepare_keyterms, which stripskeytermsfrom the generatedconvertcall and injects them viarequest_options.additional_body_parameters. Sync and asyncconvertoverrides 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.