frames: add new TaskFrame
TaskFrame is a base class for other frames that are meant to be sent to the pipeline task.
This commit is contained in:
@@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
|
- Added new base `TaskFrame` (which is a system frame). This is the base class
|
||||||
|
for all task frames (`EndTaskFrame`, `CancelTaskFrame`, etc.) that are meant
|
||||||
|
to be pushed upstream to reach the pipeline task.
|
||||||
|
|
||||||
- Expanded support for universal `LLMContext` to the AWS Bedrock LLM service.
|
- Expanded support for universal `LLMContext` to the AWS Bedrock LLM service.
|
||||||
Using the universal `LLMContext` and associated `LLMContextAggregatorPair` is
|
Using the universal `LLMContext` and associated `LLMContextAggregatorPair` is
|
||||||
a pre-requisite for using `LLMSwitcher` to switch between LLMs at runtime.
|
a pre-requisite for using `LLMSwitcher` to switch between LLMs at runtime.
|
||||||
|
|||||||
@@ -788,43 +788,6 @@ class FatalErrorFrame(ErrorFrame):
|
|||||||
fatal: bool = field(default=True, init=False)
|
fatal: bool = field(default=True, init=False)
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
|
||||||
class EndTaskFrame(SystemFrame):
|
|
||||||
"""Frame to request graceful pipeline task closure.
|
|
||||||
|
|
||||||
This is used to notify the pipeline task that the pipeline should be
|
|
||||||
closed nicely (flushing all the queued frames) by pushing an EndFrame
|
|
||||||
downstream. This frame should be pushed upstream.
|
|
||||||
"""
|
|
||||||
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
|
||||||
class CancelTaskFrame(SystemFrame):
|
|
||||||
"""Frame to request immediate pipeline task cancellation.
|
|
||||||
|
|
||||||
This is used to notify the pipeline task that the pipeline should be
|
|
||||||
stopped immediately by pushing a CancelFrame downstream. This frame
|
|
||||||
should be pushed upstream.
|
|
||||||
"""
|
|
||||||
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
|
||||||
class StopTaskFrame(SystemFrame):
|
|
||||||
"""Frame to request pipeline task stop while keeping processors running.
|
|
||||||
|
|
||||||
This is used to notify the pipeline task that it should be stopped as
|
|
||||||
soon as possible (flushing all the queued frames) but that the pipeline
|
|
||||||
processors should be kept in a running state. This frame should be pushed
|
|
||||||
upstream.
|
|
||||||
"""
|
|
||||||
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class FrameProcessorPauseUrgentFrame(SystemFrame):
|
class FrameProcessorPauseUrgentFrame(SystemFrame):
|
||||||
"""Frame to pause frame processing immediately.
|
"""Frame to pause frame processing immediately.
|
||||||
@@ -1289,6 +1252,62 @@ class SpeechControlParamsFrame(SystemFrame):
|
|||||||
turn_params: Optional[SmartTurnParams] = None
|
turn_params: Optional[SmartTurnParams] = None
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Task frames
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class TaskFrame(SystemFrame):
|
||||||
|
"""Base frame for task frames.
|
||||||
|
|
||||||
|
This is a base class for frames that are meant to be sent and handled
|
||||||
|
upstream by the pipeline task. This might result in a corresponding frame
|
||||||
|
sent downstream (e.g. `InterruptionTaskFrame` / `InterruptionFrame` or
|
||||||
|
`EndTaskFrame` / `EndFrame`).
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class EndTaskFrame(TaskFrame):
|
||||||
|
"""Frame to request graceful pipeline task closure.
|
||||||
|
|
||||||
|
This is used to notify the pipeline task that the pipeline should be
|
||||||
|
closed nicely (flushing all the queued frames) by pushing an EndFrame
|
||||||
|
downstream. This frame should be pushed upstream.
|
||||||
|
"""
|
||||||
|
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class CancelTaskFrame(TaskFrame):
|
||||||
|
"""Frame to request immediate pipeline task cancellation.
|
||||||
|
|
||||||
|
This is used to notify the pipeline task that the pipeline should be
|
||||||
|
stopped immediately by pushing a CancelFrame downstream. This frame
|
||||||
|
should be pushed upstream.
|
||||||
|
"""
|
||||||
|
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class StopTaskFrame(TaskFrame):
|
||||||
|
"""Frame to request pipeline task stop while keeping processors running.
|
||||||
|
|
||||||
|
This is used to notify the pipeline task that it should be stopped as
|
||||||
|
soon as possible (flushing all the queued frames) but that the pipeline
|
||||||
|
processors should be kept in a running state. This frame should be pushed
|
||||||
|
upstream.
|
||||||
|
"""
|
||||||
|
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Control frames
|
# Control frames
|
||||||
#
|
#
|
||||||
|
|||||||
Reference in New Issue
Block a user