(summary) relaxed WhisperX response model

When going through AlbertAPI, timestamp are not provided at the word level.
This adds default values so that the summary external contract stays the same,
while giving us compatibility wisht AlbertAPI.
This commit is contained in:
Florent Chehab
2026-06-12 12:45:40 +02:00
parent 7256b87511
commit 5c27aba00f
+6 -2
View File
@@ -40,7 +40,9 @@ class Segment(BaseModel):
title="Segment Text", description="Transcribed text for the segment."
)
words: tuple[WordSegment, ...] | None = Field(
title="Word Segments", description="List of word segments within the segment."
title="Word Segments",
description="List of word segments within the segment.",
default=None,
)
speaker: str | None = Field(
default=None, title="Speaker", description="Speaker identifier for the segment."
@@ -54,7 +56,9 @@ class WhisperXResponse(BaseModel):
title="Segments", description="List of transcribed segments."
)
word_segments: tuple[WordSegment, ...] = Field(
title="Word Segments", description="List of word segments."
title="Word Segments",
description="List of word segments.",
default_factory=tuple,
)