Conversation
Every other STT provider reads a base URL from its own config block — openai (`_resolve_openai_stt_client_config`), xai, elevenlabs and deepinfra all do. `_transcribe_mistral` was the exception: it built `Mistral(api_key=api_key)` with no `server_url`, so `stt.provider: mistral` could only ever address api.mistral.ai. The TTS half already has this. NousResearch#73512 introduced what its description calls "class-level base_url parity" for TTS providers, and `_generate_mistral_tts` has read `tts.mistral.base_url` into the SDK's `server_url` since. This is the same change for the transcription side, in the shape `_transcribe_elevenlabs` uses: config block, then env, then the module constant. Unset, no `server_url` is passed at all and the SDK keeps its own endpoint, so an install that does not configure this behaves exactly as before. Why it matters: a self-hosted gateway or authenticating reverse proxy in front of Mistral is reachable for TTS and unreachable for STT, which makes the provider pair unusable in that deployment for no reason visible from the configuration.
Contributor
Overall: Completes endpoint parity for Mistral STT — What it does
Non-blocking notes
Small parity completion; no breaking change when unset. Non-blocking — please use your judgment. |
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.
What does this PR do?
stt.provider: mistralcan only ever addressapi.mistral.ai._transcribe_mistralbuilds its client asMistral(api_key=api_key)with noserver_url, so no configuration reaches the endpoint.Every other STT provider already honors a base URL from its own config block —
openai(_resolve_openai_stt_client_config),xai,elevenlabsanddeepinfra. Mistral is the exception.The TTS half is not: #73512 introduced what its description calls class-level
base_urlparity for TTS providers, and_generate_mistral_ttshas readtts.mistral.base_urlinto the SDK'sserver_urlsince. This is the same change for the transcription side, in the shape_transcribe_elevenlabsuses — config block, then env, then module constant.Unset, no
server_urlis passed at all and the SDK keeps its own endpoint, so an install that does not configure this behaves exactly as before.Why it matters. A self-hosted gateway or authenticating reverse proxy in front of Mistral is reachable for synthesis and unreachable for transcription, which makes the provider pair unusable in that deployment — with nothing in the configuration to indicate why. Concretely, this came up routing both directions through Tailscale Aperture, whose HTTP connector answers
/v1/audio/speechand/v1/audio/transcriptionsidentically; TTS could be pointed at it, STT could not.Related Issue
None open that I could find — searched
stt base_url,voxtral, andvoxtral endpointacross issues and PRs per CONTRIBUTING § Search First. The closest prior art is #73512 (merged), which this continues.Type of Change
Changes Made
tools/transcription_tools.py—_transcribe_mistralresolvesstt.mistral.base_url→STT_MISTRAL_BASE_URL→MISTRAL_STT_BASE_URL(new module constant, empty by default) and passes it to the SDK asserver_urlonly when set.tests/tools/test_transcription_tools.py— three cases inTestTranscribeMistral: configbase_urlbecomesserver_url(with trailing-slash normalization), an unconfigured provider passes noserver_urlat all, and the env variable applies when the config block is silent.website/docs/user-guide/features/tts.md— the key in the STT config block, and a sentence in the Mistral provider detail.website/docs/reference/environment-variables.md—STT_MISTRAL_BASE_URL.How to Test
python -m pytest tests/tools/test_transcription_tools.py -k "Mistral or mistral"— 9 passed.Regression across the transcription suite:
python -m pytest tests/tools/test_transcription_tools.py tests/tools/test_pre_transcription_hook.py tests/tools/test_transcription.py tests/tools/test_stt_language_resolution.py— 101 passed.End to end against a real proxy: set
and send a voice message. Verified this way on agent v0.20.6 against a Tailscale Aperture HTTP connector, which returned the correct transcript; without the change the same configuration reaches api.mistral.ai and the
base_urlvalue is ignored.