Repository navigation
fix(audio): honor the selected transcription client without provider fallback - #2706
Open
Çağdaş Yürekli (cagdasyurekli) wants to merge 1 commit into
Conversation
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.
When
MarkItDown(llm_client=client)converts audio, the built-in converter ignores the selected client and sends the recording through SpeechRecognition's legacy Google service. Honor the explicitly selected OpenAI-compatible audio transcription client instead, with no cross-provider fallback on provider failure.The selected client receives the original encoded stream with its matching filename and MIME type (
audio/mpegfor MP3), usingwhisper-1. This path does not require legacy SpeechRecognition or local decoding dependencies. The existing no-client Google default and its language hint remain compatible and are now documented explicitly.Addresses the configured-client part of #1284. This is a focused current-main alternative to the stale/conflicting #326; unlike its fallback behavior, a selected provider stays selected when it fails. It does not close the broader policy question about the no-client Google default.
Validation on Python 3.12: 8 new cases fail against unchanged main, then all 9 provider-selection/format cases pass; full core suite 1,059 passed, 57 skipped under existing CI skip conditions. Black 23.7.0 and diff checks pass. Independent OpenAI SDK multipart checks verify original audio bytes, filename/MIME and absence of SpeechRecognition; all provider requests are mocked and no recording leaves the test process.
Net change: +19 production lines, +103 test lines, +14 documentation lines. No dependencies, CLI flags or hosted workflows added.