Files
pipecat/changelog/3045.added.md
2025-12-28 08:16:34 -08:00

41 lines
1.7 KiB
Markdown

- Introducing user and bot turn start strategies. Turn start strategies indicate when user and bot turns begin. In conversational agents, these are often referred to as start/stop speaking or turn-taking plans or policies.
User turn start strategies indicate when the user starts speaking (e.g. using VAD events or when a user says one or more words).
Bot turn start strategies indicate when the bot should start speaking (e.g. using an end-of-turn detection model or by observing incoming transcriptions).
A list of strategies can be specified for both the user and the bot; strategies are evaluated in order until one evaluates to true.
Available user turn start strategies:
- VADUserTurnStartStrategy
- TranscriptionUserTurnStartStrategy
- MinWordsUserTurnStartStrategy
Available bot turn start strategies:
- TranscriptionBotTurnStartStrategy
- TurnAnalyzerBotTurnStartStrategy
The default strategies are:
- user: [VADUserTurnStartStrategy, TranscriptionUserTurnStartStrategy]
- bot: [TranscriptionBotTurnStartStrategy]
Turn start strategies are configured when setting up `LLMContextAggregatorPair`. For example:
```python
context_aggregator = LLMContextAggregatorPair(
context,
user_params=LLMUserAggregatorParams(
turn_start_strategies=TurnStartStrategies(
bot=[
TurnAnalyzerBotTurnStartStrategy(
turn_analyzer=LocalSmartTurnAnalyzerV3(params=SmartTurnParams())
)
],
)
),
)
```
In order to use the turn start strategies you should update to the new universal `LLMContext` and `LLMContextAggregatorPair`.