feat(backend): extend type unions to accept SaluteSpeechSegment

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Daniil
2026-04-03 23:59:19 +03:00
parent dfcb0f96bc
commit 9a71fa9f25
+5 -2
View File
@@ -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: