From 9a71fa9f257dd995786b64b676d16bdba1654c8d Mon Sep 17 00:00:00 2001 From: Daniil Date: Fri, 3 Apr 2026 23:59:19 +0300 Subject: [PATCH] feat(backend): extend type unions to accept SaluteSpeechSegment Co-Authored-By: Claude Sonnet 4.6 --- cpv3/modules/transcription/service.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cpv3/modules/transcription/service.py b/cpv3/modules/transcription/service.py index 411f07d..5bb7041 100644 --- a/cpv3/modules/transcription/service.py +++ b/cpv3/modules/transcription/service.py @@ -28,6 +28,7 @@ from cpv3.modules.transcription.schemas import ( GoogleSpeechSegment, GoogleSpeechWord, LineNode, + SaluteSpeechSegment, SegmentNode, Tag, TimeRange, @@ -41,7 +42,9 @@ from cpv3.modules.transcription.schemas import ( class DocumentBuilder: def compute_segment_lines( - self, segment: WhisperSegment | GoogleSpeechSegment, max_chars_per_line: int + self, + segment: WhisperSegment | GoogleSpeechSegment | SaluteSpeechSegment, + max_chars_per_line: int, ) -> list[LineNode]: words = segment.words or [] lines: list[list[WhisperWord | GoogleSpeechWord]] = [] @@ -219,7 +222,7 @@ async def _convert_local_to_ogg(input_path: str) -> tuple[str, Callable[[], None def _make_document_from_segments( builder: DocumentBuilder, - segments: list[WhisperSegment] | list[GoogleSpeechSegment], + segments: list[WhisperSegment] | list[GoogleSpeechSegment] | list[SaluteSpeechSegment], *, max_line_width: int, ) -> Document: