SimpleTextAggregator
- class pipecat.utils.text.simple_text_aggregator.SimpleTextAggregator[source]
Bases:
BaseTextAggregator
This is a simple text aggregator. It aggregates text until an end of sentence is found.
- property text: str
Returns the currently aggregated text.
- async aggregate(text)[source]
Aggregates the specified text with the currently accumulated text.
This method should be implemented to define how the new text contributes to the aggregation process. It returns the updated aggregated text if it’s ready to be processed, or None otherwise.
- Parameters:
text (str) – The text to be aggregated.
- Returns:
The updated aggregated text or None if aggregated text is not ready.
- Return type:
Optional[str]
- async handle_interruption()[source]
Handles interruptions. When an interruption occurs it is possible that we might want to discard the aggregated text or do some internal modifications to the aggregated text.
- async reset()[source]
Clears the internally aggregated text.