@@ -464,6 +464,49 @@ def test_7c_pipeline_id_empty_properties_no_vendors() -> None:
464464 assert "tts" not in properties
465465
466466
467+ def test_7d_pipeline_id_with_byok_tts_only () -> None :
468+ """7d: pipeline_id present, TTS-only BYOK override — ASR and LLM absent from properties."""
469+ agent = Agent (name = "support" , pipeline_id = "studio-pipeline" ).with_tts (
470+ ElevenLabsTTS (
471+ key = "el-key" ,
472+ model_id = "eleven_flash_v2_5" ,
473+ voice_id = "some-voice" ,
474+ base_url = "wss://api.elevenlabs.io/v1" ,
475+ )
476+ )
477+
478+ call = start_session (agent )
479+ assert call ["pipeline_id" ] == "studio-pipeline"
480+ properties = dump (call ["properties" ])
481+ assert "asr" not in properties
482+ assert "llm" not in properties
483+ assert properties ["tts" ]["vendor" ] == "elevenlabs"
484+ assert properties ["tts" ]["params" ]["key" ] == "el-key"
485+
486+
487+ def test_7e_pipeline_id_with_byok_asr_and_tts () -> None :
488+ """7e: pipeline_id present, ASR+TTS BYOK overrides — LLM absent from properties."""
489+ agent = (
490+ Agent (name = "support" , pipeline_id = "studio-pipeline" )
491+ .with_stt (DeepgramSTT (api_key = "dg-key" , language = "en" ))
492+ .with_tts (
493+ ElevenLabsTTS (
494+ key = "el-key" ,
495+ model_id = "eleven_flash_v2_5" ,
496+ voice_id = "some-voice" ,
497+ base_url = "wss://api.elevenlabs.io/v1" ,
498+ )
499+ )
500+ )
501+
502+ call = start_session (agent )
503+ assert call ["pipeline_id" ] == "studio-pipeline"
504+ properties = dump (call ["properties" ])
505+ assert "llm" not in properties
506+ assert properties ["asr" ]["vendor" ] == "deepgram"
507+ assert properties ["tts" ]["vendor" ] == "elevenlabs"
508+
509+
467510# ===========================================================================
468511# Scenario 8 — MLLM mode
469512# ===========================================================================
@@ -872,10 +915,11 @@ def test_byok_sarvam_tts_params() -> None:
872915
873916
874917def test_byok_murf_tts_params () -> None :
875- agent = Agent (name = "t" ).with_tts (MurfTTS (key = "murf-key" ))
918+ agent = Agent (name = "t" ).with_tts (MurfTTS (key = "murf-key" , voice_id = "Ariana" ))
876919 props = build_properties (agent , allow_missing = {"asr" , "llm" })
877920 assert props ["tts" ]["vendor" ] == "murf"
878921 assert props ["tts" ]["params" ]["api_key" ] == "murf-key"
922+ assert props ["tts" ]["params" ]["voiceId" ] == "Ariana"
879923
880924
881925# ---------------------------------------------------------------------------
@@ -965,3 +1009,15 @@ def test_preset_minimax_speech_2_8_turbo_inferred() -> None:
9651009def test_preset_minimax_speech_2_6_turbo_inferred () -> None :
9661010 preset , properties = resolve_session_presets (None , {"tts" : MiniMaxTTS (model = "speech-2.6-turbo" , voice_id = "voice" ).to_config ()})
9671011 assert preset == "minimax_speech_2_6_turbo"
1012+
1013+
1014+ def test_explicit_minimax_preset_strips_internal_hint () -> None :
1015+ """Explicit MiniMax TTS preset must not leak _minimax_preset_model to the wire."""
1016+ # When the caller supplies the preset explicitly, inference is skipped but the
1017+ # internal _minimax_preset_model hint set by MiniMaxTTS.to_config() must still
1018+ # be removed before the POST body is sent.
1019+ tts_config = MiniMaxTTS (model = "speech_2_8_turbo" , voice_id = "voice" ).to_config ()
1020+ assert "_minimax_preset_model" in tts_config # confirm the hint is set pre-strip
1021+
1022+ _ , properties = resolve_session_presets ("minimax_speech_2_8_turbo" , {"tts" : tts_config })
1023+ assert "_minimax_preset_model" not in properties ["tts" ]
0 commit comments