Initial commit of current state

This commit is contained in:
Adolfo Reyna
2026-08-07 18:15:36 -04:00
commit 62d805e565
32 changed files with 4416 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
"""Rewrite transcripts before anything downstream reads them.
Sits between the recogniser and the turn aggregator so the substitutions apply
whichever speech engine is in use, and so the corrected text is what reaches
Claude, the logs, and any future meeting-notes writer alike.
"""
from loguru import logger
from pipecat.frames.frames import Frame, TranscriptionFrame
from pipecat.processors.frame_processor import FrameDirection, FrameProcessor
from vocabulary import Vocabulary
class TranscriptRepair(FrameProcessor):
"""Apply the vocabulary's repair rules to every transcription."""
def __init__(self, vocabulary: Vocabulary, **kwargs):
super().__init__(**kwargs)
self._vocabulary = vocabulary
async def process_frame(self, frame: Frame, direction: FrameDirection):
await super().process_frame(frame, direction)
if isinstance(frame, TranscriptionFrame):
repaired = self._vocabulary.repair(frame.text)
if repaired != frame.text:
logger.debug(f"Repaired transcript: {frame.text!r} -> {repaired!r}")
frame.text = repaired
await self.push_frame(frame, direction)