frames: added vision response and text frames

This commit is contained in:
Aleix Conchillo Flaqué
2025-12-17 10:34:54 -08:00
parent e03e5f3a59
commit d3d50ac580
2 changed files with 28 additions and 0 deletions

2
changelog/3252.added.md Normal file
View File

@@ -0,0 +1,2 @@
- Added `VisionFullResponseStartFrame`, `VisionFullResponseEndFrame` and
`VisionTextFrame`. This are used by vision services similar to LLM services.

View File

@@ -400,6 +400,13 @@ class AggregatedTextFrame(TextFrame):
aggregated_by: AggregationType | str
@dataclass
class VisionTextFrame(LLMTextFrame):
"""Text frame generated by vision services."""
pass
@dataclass
class TTSTextFrame(AggregatedTextFrame):
"""Text frame generated by Text-to-Speech services."""
@@ -1766,6 +1773,25 @@ class FunctionCallInProgressFrame(ControlFrame, UninterruptibleFrame):
cancel_on_interruption: bool = False
@dataclass
class VisionFullResponseStartFrame(LLMFullResponseStartFrame):
"""Frame indicating the beginning of a vision model response.
Used to indicate the beginning of a vision model response. Followed by one
or more VisionTextFrames and a final VisionFullResponseEndFrame.
"""
pass
@dataclass
class VisionFullResponseEndFrame(LLMFullResponseEndFrame):
"""Frame indicating the end of a Vision model response."""
pass
@dataclass
class TTSStartedFrame(ControlFrame):
"""Frame indicating the beginning of a TTS response.