fix: preserve skip_tts flag when frames pass through LLM services
Only set skip_tts=True when _skip_tts is configured, rather than unconditionally overwriting the frame's skip_tts value. This preserves frames that already have skip_tts=True when passing through LLM services. Fixes issue where LLMTextFrame with skip_tts=True would exit LLMSwitcher with skip_tts=False.
This commit is contained in:
@@ -292,8 +292,11 @@ class LLMService(AIService):
|
||||
frame: The frame to push.
|
||||
direction: The direction of frame pushing.
|
||||
"""
|
||||
# Only set skip_tts=True when configured, to preserve frames that already
|
||||
# have skip_tts=True. This avoids overwriting frames passing through.
|
||||
if isinstance(frame, (LLMTextFrame, LLMFullResponseStartFrame, LLMFullResponseEndFrame)):
|
||||
frame.skip_tts = self._skip_tts
|
||||
if self._skip_tts:
|
||||
frame.skip_tts = True
|
||||
|
||||
await super().push_frame(frame, direction)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user