Revert to ErrorFrame.
This commit is contained in:
@@ -16,7 +16,6 @@ from pydantic import BaseModel
|
|||||||
|
|
||||||
from pipecat.frames.frames import (
|
from pipecat.frames.frames import (
|
||||||
ErrorFrame,
|
ErrorFrame,
|
||||||
FatalErrorFrame,
|
|
||||||
Frame,
|
Frame,
|
||||||
TTSAudioRawFrame,
|
TTSAudioRawFrame,
|
||||||
TTSStartedFrame,
|
TTSStartedFrame,
|
||||||
@@ -174,15 +173,16 @@ class SpeechmaticsTTSService(TTSService):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
except (ValueError, ArithmeticError):
|
except (ValueError, ArithmeticError):
|
||||||
yield FatalErrorFrame(
|
yield ErrorFrame(
|
||||||
error=f"{self} Service unavailable [503] (attempts {attempt})"
|
error=f"{self} Service unavailable [503] (attempts {attempt})",
|
||||||
|
fatal=True,
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
# != 200 : Error
|
# != 200 : Error
|
||||||
if response.status != 200:
|
if response.status != 200:
|
||||||
yield FatalErrorFrame(
|
yield ErrorFrame(
|
||||||
error=f"{self} Service unavailable [{response.status}]"
|
error=f"{self} Service unavailable [{response.status}]", fatal=True
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -225,7 +225,7 @@ class SpeechmaticsTTSService(TTSService):
|
|||||||
break
|
break
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
yield ErrorFrame(error=f"{self}: Error generating TTS: {e}")
|
yield ErrorFrame(error=f"{self}: Error generating TTS: {e}", fatal=True)
|
||||||
finally:
|
finally:
|
||||||
# Emit the TTS stopped frame
|
# Emit the TTS stopped frame
|
||||||
yield TTSStoppedFrame()
|
yield TTSStoppedFrame()
|
||||||
|
|||||||
Reference in New Issue
Block a user