frames: add turn start strategies to StartFrame
This commit is contained in:
@@ -40,6 +40,7 @@ from pipecat.utils.utils import obj_count, obj_id
|
||||
if TYPE_CHECKING:
|
||||
from pipecat.processors.aggregators.llm_context import LLMContext, LLMContextMessage, NotGiven
|
||||
from pipecat.processors.frame_processor import FrameProcessor
|
||||
from pipecat.turns.turn_start_strategies import TurnStartStrategies
|
||||
|
||||
|
||||
class DeprecatedKeypadEntry:
|
||||
@@ -959,6 +960,7 @@ class StartFrame(SystemFrame):
|
||||
enable_tracing: bool = False
|
||||
enable_usage_metrics: bool = False
|
||||
interruption_strategies: List[BaseInterruptionStrategy] = field(default_factory=list)
|
||||
turn_start_strategies: Optional["TurnStartStrategies"] = None
|
||||
report_only_initial_ttfb: bool = False
|
||||
|
||||
|
||||
|
||||
31
src/pipecat/turns/turn_start_strategies.py
Normal file
31
src/pipecat/turns/turn_start_strategies.py
Normal file
@@ -0,0 +1,31 @@
|
||||
#
|
||||
# Copyright (c) 2024–2025, Daily
|
||||
#
|
||||
# SPDX-License-Identifier: BSD 2-Clause License
|
||||
#
|
||||
|
||||
"""Turn start strategy configuration."""
|
||||
|
||||
from dataclasses import dataclass
|
||||
from typing import List
|
||||
|
||||
from pipecat.turns.bot.base_bot_turn_start_strategy import BaseBotTurnStartStrategy
|
||||
from pipecat.turns.user.base_user_turn_start_strategy import BaseUserTurnStartStrategy
|
||||
|
||||
|
||||
@dataclass
|
||||
class TurnStartStrategies:
|
||||
"""Container for user and bot turn start strategies.
|
||||
|
||||
This class groups the configured turn start strategies for both the user
|
||||
and the bot.
|
||||
|
||||
Attributes:
|
||||
user: A list of user turn start strategies used to detect when the
|
||||
user starts speaking.
|
||||
bot: A list of bot turn start strategies used to decide when the bot
|
||||
should start speaking.
|
||||
"""
|
||||
|
||||
user: List[BaseUserTurnStartStrategy]
|
||||
bot: List[BaseBotTurnStartStrategy]
|
||||
Reference in New Issue
Block a user