diff --git a/homeassistant/components/elevenlabs/const.py b/homeassistant/components/elevenlabs/const.py index 6eeed3d9ca13..d5e31789a3c0 100644 --- a/homeassistant/components/elevenlabs/const.py +++ b/homeassistant/components/elevenlabs/const.py @@ -19,7 +19,7 @@ DEFAULT_STYLE = 0 DEFAULT_USE_SPEAKER_BOOST = True MAX_REQUEST_IDS = 3 -MODELS_PREVIOUS_INFO_NOT_SUPPORTED = ("eleven_v3",) +MODELS_PREVIOUS_INFO_NOT_SUPPORTED = ("eleven_v3", "eleven_v3_conversational") STT_LANGUAGES = [ "af-ZA", # Afrikaans diff --git a/tests/components/elevenlabs/test_tts.py b/tests/components/elevenlabs/test_tts.py index 96caaad2a155..822ca425ec4c 100644 --- a/tests/components/elevenlabs/test_tts.py +++ b/tests/components/elevenlabs/test_tts.py @@ -614,31 +614,33 @@ async def test_stream_tts_with_request_ids( ), ], ) +@pytest.mark.parametrize( + "model", + [ + pytest.param("eleven_v3", id="eleven_v3"), + pytest.param("eleven_v3_conversational", id="eleven_v3_conversational"), + ], +) async def test_stream_tts_without_previous_info( setup: AsyncMock, hass: HomeAssistant, hass_client: ClientSessionGenerator, capture_stream_calls, stream_sentence_helpers, - monkeypatch: pytest.MonkeyPatch, message: list[list[str]], chunks: list[bytes], request_ids: list[str], + model: str, ) -> None: - """Test streaming TTS without request-id stitching (eleven_v3).""" + """Test streaming TTS without request-id stitching for eleven_v3 models.""" calls, set_next_return, patch_stream = capture_stream_calls tts_entity = hass.data[tts.DOMAIN].get_entity("tts.elevenlabs_text_to_speech") patch_stream(tts_entity) - monkeypatch.setattr( - "homeassistant.components.elevenlabs.tts.MODELS_PREVIOUS_INFO_NOT_SUPPORTED", - ("model1",), - raising=False, - ) queue = asyncio.Queue() sentence_iter = iter(zip(message, chunks, request_ids, strict=False)) get_next_part, message_gen = stream_sentence_helpers(sentence_iter, queue) - options = {tts.ATTR_VOICE: "voice1", "model": "model1"} + options = {tts.ATTR_VOICE: "voice1", "model": model} req = TTSAudioRequest(message_gen=message_gen(), language="en", options=options) resp = await tts_entity.async_stream_tts_audio(req)