From 5c27aba00f067892a586577bfc8edb96b65128a5 Mon Sep 17 00:00:00 2001 From: Florent Chehab Date: Fri, 12 Jun 2026 12:45:40 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8(summary)=20relaxed=20WhisperX=20respo?= =?UTF-8?q?nse=20model?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- src/summary/summary/core/shared_models.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/summary/summary/core/shared_models.py b/src/summary/summary/core/shared_models.py index 6ce6f584..b18c81cc 100644 --- a/src/summary/summary/core/shared_models.py +++ b/src/summary/summary/core/shared_models.py @@ -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, )