Fixing Piper test.

This commit is contained in:
filipi87
2026-03-09 12:07:45 -03:00
parent 8ec160f71e
commit f0c5925a79
2 changed files with 3 additions and 1 deletions

View File

@@ -17,6 +17,7 @@ from loguru import logger
from pipecat.frames.frames import ( from pipecat.frames.frames import (
ErrorFrame, ErrorFrame,
Frame, Frame,
TTSStoppedFrame,
) )
from pipecat.services.settings import TTSSettings, _warn_deprecated_param from pipecat.services.settings import TTSSettings, _warn_deprecated_param
from pipecat.services.tts_service import TTSService from pipecat.services.tts_service import TTSService
@@ -287,6 +288,7 @@ class PiperHttpTTSService(TTSService):
yield ErrorFrame( yield ErrorFrame(
error=f"Error getting audio (status: {response.status}, error: {error})" error=f"Error getting audio (status: {response.status}, error: {error})"
) )
yield TTSStoppedFrame(context_id=context_id)
return return
await self.start_tts_usage_metrics(text) await self.start_tts_usage_metrics(text)

View File

@@ -136,7 +136,7 @@ async def test_run_piper_tts_error(aiohttp_client):
TTSSpeakFrame(text="Error case.", append_to_context=False), TTSSpeakFrame(text="Error case.", append_to_context=False),
] ]
expected_down_frames = [AggregatedTextFrame, TTSStartedFrame, TTSTextFrame, TTSStoppedFrame] expected_down_frames = [AggregatedTextFrame, TTSStartedFrame, TTSStoppedFrame, TTSTextFrame]
expected_up_frames = [ErrorFrame] expected_up_frames = [ErrorFrame]