TextFrame: add skip_tts field

This lets a text frame bypass TTS while still being included in the LLM
context. Useful for cases like structured text that isn’t meant to be spoken but
should still contribute to context.
This commit is contained in:
Aleix Conchillo Flaqué
2025-08-26 12:38:30 -07:00
parent d9837dd1e5
commit 5803936838
3 changed files with 12 additions and 1 deletions

View File

@@ -305,6 +305,11 @@ class TextFrame(DataFrame):
"""
text: str
skip_tts: bool = field(init=False)
def __post_init__(self):
super().__post_init__()
self.skip_tts = False
def __str__(self):
pts = format_pts(self.pts)

View File

@@ -296,7 +296,9 @@ class TTSService(AIService):
"""
await super().process_frame(frame, direction)
if (
if isinstance(frame, TextFrame) and frame.skip_tts:
await self.push_frame(frame, direction)
elif (
isinstance(frame, TextFrame)
and not isinstance(frame, InterimTranscriptionFrame)
and not isinstance(frame, TranscriptionFrame)