minor turn start strategies cleanup

This commit is contained in:
Aleix Conchillo Flaqué
2025-12-24 10:29:48 -08:00
parent c33c8d2195
commit 30922d365f
4 changed files with 13 additions and 11 deletions

View File

@@ -956,6 +956,10 @@ class StartFrame(SystemFrame):
enable_tracing: Whether to enable OpenTelemetry tracing. enable_tracing: Whether to enable OpenTelemetry tracing.
enable_usage_metrics: Whether to enable usage metrics collection. enable_usage_metrics: Whether to enable usage metrics collection.
interruption_strategies: List of interruption handling strategies. interruption_strategies: List of interruption handling strategies.
.. deprecated:: 0.0.99
Use the `turn_start_strategies` instead.
report_only_initial_ttfb: Whether to report only initial time-to-first-byte. report_only_initial_ttfb: Whether to report only initial time-to-first-byte.
""" """

View File

@@ -359,7 +359,7 @@ class FrameProcessor(BaseObject):
def interruption_strategies(self) -> Sequence[BaseInterruptionStrategy]: def interruption_strategies(self) -> Sequence[BaseInterruptionStrategy]:
"""Get the interruption strategies for this processor. """Get the interruption strategies for this processor.
.. deprecated:: 0.0.98 .. deprecated:: 0.0.99
This function is deprecated, use the new user and bot turn start This function is deprecated, use the new user and bot turn start
strategies insted. strategies insted.

View File

@@ -43,10 +43,6 @@ class BaseBotTurnStartStrategy(BaseObject):
raise RuntimeError(f"{self} bot turn start strategy was not properly setup") raise RuntimeError(f"{self} bot turn start strategy was not properly setup")
return self._task_manager return self._task_manager
async def reset(self):
"""Reset the strategy to its initial state."""
pass
async def setup(self, task_manager: BaseTaskManager): async def setup(self, task_manager: BaseTaskManager):
"""Initialize the strategy with the given task manager. """Initialize the strategy with the given task manager.
@@ -59,6 +55,10 @@ class BaseBotTurnStartStrategy(BaseObject):
"""Cleanup the strategy.""" """Cleanup the strategy."""
pass pass
async def reset(self):
"""Reset the strategy to its initial state."""
pass
async def process_frame(self, frame: Frame): async def process_frame(self, frame: Frame):
"""Process an incoming frame to decide whether the bot should speak. """Process an incoming frame to decide whether the bot should speak.
@@ -67,7 +67,6 @@ class BaseBotTurnStartStrategy(BaseObject):
Args: Args:
frame: The frame to be analyzed. frame: The frame to be analyzed.
""" """
pass pass

View File

@@ -43,10 +43,6 @@ class BaseUserTurnStartStrategy(BaseObject):
raise RuntimeError(f"{self} user turn start strategy was not properly setup") raise RuntimeError(f"{self} user turn start strategy was not properly setup")
return self._task_manager return self._task_manager
async def reset(self):
"""Reset the strategy to its initial state."""
pass
async def setup(self, task_manager: BaseTaskManager): async def setup(self, task_manager: BaseTaskManager):
"""Initialize the strategy with the given task manager. """Initialize the strategy with the given task manager.
@@ -59,6 +55,10 @@ class BaseUserTurnStartStrategy(BaseObject):
"""Cleanup the strategy.""" """Cleanup the strategy."""
pass pass
async def reset(self):
"""Reset the strategy to its initial state."""
pass
async def process_frame(self, frame: Frame): async def process_frame(self, frame: Frame):
"""Process an incoming frame. """Process an incoming frame.
@@ -67,7 +67,6 @@ class BaseUserTurnStartStrategy(BaseObject):
Args: Args:
frame: The frame to be processed. frame: The frame to be processed.
""" """
pass pass