LLMUserContextAggregator: add space between transcriptions
This commit is contained in:
@@ -287,7 +287,7 @@ class LLMUserContextAggregator(LLMContextResponseAggregator):
|
|||||||
await self.push_aggregation()
|
await self.push_aggregation()
|
||||||
|
|
||||||
async def _handle_transcription(self, frame: TranscriptionFrame):
|
async def _handle_transcription(self, frame: TranscriptionFrame):
|
||||||
self._aggregation += frame.text
|
self._aggregation += f" {frame.text}" if self._aggregation else frame.text
|
||||||
# We just got a final result, so let's reset interim results.
|
# We just got a final result, so let's reset interim results.
|
||||||
self._seen_interim_results = False
|
self._seen_interim_results = False
|
||||||
# Reset aggregation timer.
|
# Reset aggregation timer.
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ class BaseTestUserContextAggregator:
|
|||||||
aggregator = self.AGGREGATOR_CLASS(context)
|
aggregator = self.AGGREGATOR_CLASS(context)
|
||||||
frames_to_send = [
|
frames_to_send = [
|
||||||
UserStartedSpeakingFrame(),
|
UserStartedSpeakingFrame(),
|
||||||
TranscriptionFrame(text="Hello Pipecat! ", user_id="cat", timestamp=""),
|
TranscriptionFrame(text="Hello Pipecat!", user_id="cat", timestamp=""),
|
||||||
InterimTranscriptionFrame(text="How ", user_id="cat", timestamp=""),
|
InterimTranscriptionFrame(text="How ", user_id="cat", timestamp=""),
|
||||||
SleepFrame(),
|
SleepFrame(),
|
||||||
UserStoppedSpeakingFrame(),
|
UserStoppedSpeakingFrame(),
|
||||||
@@ -271,7 +271,7 @@ class BaseTestUserContextAggregator:
|
|||||||
frames_to_send = [
|
frames_to_send = [
|
||||||
UserStartedSpeakingFrame(),
|
UserStartedSpeakingFrame(),
|
||||||
UserStoppedSpeakingFrame(),
|
UserStoppedSpeakingFrame(),
|
||||||
TranscriptionFrame(text="Hello Pipecat! ", user_id="cat", timestamp=""),
|
TranscriptionFrame(text="Hello Pipecat!", user_id="cat", timestamp=""),
|
||||||
TranscriptionFrame(text="How are you?", user_id="cat", timestamp=""),
|
TranscriptionFrame(text="How are you?", user_id="cat", timestamp=""),
|
||||||
SleepFrame(sleep=AGGREGATION_SLEEP),
|
SleepFrame(sleep=AGGREGATION_SLEEP),
|
||||||
]
|
]
|
||||||
@@ -298,7 +298,7 @@ class BaseTestUserContextAggregator:
|
|||||||
InterimTranscriptionFrame(text="Hello ", user_id="cat", timestamp=""),
|
InterimTranscriptionFrame(text="Hello ", user_id="cat", timestamp=""),
|
||||||
SleepFrame(),
|
SleepFrame(),
|
||||||
UserStoppedSpeakingFrame(),
|
UserStoppedSpeakingFrame(),
|
||||||
TranscriptionFrame(text="Hello Pipecat! ", user_id="cat", timestamp=""),
|
TranscriptionFrame(text="Hello Pipecat!", user_id="cat", timestamp=""),
|
||||||
InterimTranscriptionFrame(text="How ", user_id="cat", timestamp=""),
|
InterimTranscriptionFrame(text="How ", user_id="cat", timestamp=""),
|
||||||
TranscriptionFrame(text="How are you?", user_id="cat", timestamp=""),
|
TranscriptionFrame(text="How are you?", user_id="cat", timestamp=""),
|
||||||
SleepFrame(sleep=AGGREGATION_SLEEP),
|
SleepFrame(sleep=AGGREGATION_SLEEP),
|
||||||
Reference in New Issue
Block a user