From 68aa97e63163d0dbc6c6829f0116cade28c65380 Mon Sep 17 00:00:00 2001 From: Luke Oliff Date: Thu, 29 Jan 2026 21:28:03 +0000 Subject: [PATCH] fix(types): change speaker and related fields from float to int Changed speaker, channel, and num_words fields from float to int in Listen V1 response types to match actual API response format. This fixes subtitle generation issues where speakers were displayed as "speaker 0.0" instead of "speaker 0". Fixes #641 --- ...nnels_item_alternatives_item_paragraphs_paragraphs_item.py | 4 ++-- .../types/listen_v1response_results_utterances_item.py | 4 ++-- .../listen_v1response_results_utterances_item_words_item.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/deepgram/types/listen_v1response_results_channels_item_alternatives_item_paragraphs_paragraphs_item.py b/src/deepgram/types/listen_v1response_results_channels_item_alternatives_item_paragraphs_paragraphs_item.py index 1ba52c63..d38e7e39 100644 --- a/src/deepgram/types/listen_v1response_results_channels_item_alternatives_item_paragraphs_paragraphs_item.py +++ b/src/deepgram/types/listen_v1response_results_channels_item_alternatives_item_paragraphs_paragraphs_item.py @@ -13,8 +13,8 @@ class ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsIte sentences: typing.Optional[ typing.List[ListenV1ResponseResultsChannelsItemAlternativesItemParagraphsParagraphsItemSentencesItem] ] = None - speaker: typing.Optional[float] = None - num_words: typing.Optional[float] = None + speaker: typing.Optional[int] = None + num_words: typing.Optional[int] = None start: typing.Optional[float] = None end: typing.Optional[float] = None diff --git a/src/deepgram/types/listen_v1response_results_utterances_item.py b/src/deepgram/types/listen_v1response_results_utterances_item.py index a570ac99..a9ce5e77 100644 --- a/src/deepgram/types/listen_v1response_results_utterances_item.py +++ b/src/deepgram/types/listen_v1response_results_utterances_item.py @@ -11,10 +11,10 @@ class ListenV1ResponseResultsUtterancesItem(UniversalBaseModel): start: typing.Optional[float] = None end: typing.Optional[float] = None confidence: typing.Optional[float] = None - channel: typing.Optional[float] = None + channel: typing.Optional[int] = None transcript: typing.Optional[str] = None words: typing.Optional[typing.List[ListenV1ResponseResultsUtterancesItemWordsItem]] = None - speaker: typing.Optional[float] = None + speaker: typing.Optional[int] = None id: typing.Optional[str] = None if IS_PYDANTIC_V2: diff --git a/src/deepgram/types/listen_v1response_results_utterances_item_words_item.py b/src/deepgram/types/listen_v1response_results_utterances_item_words_item.py index 21633fd3..7c3cfc84 100644 --- a/src/deepgram/types/listen_v1response_results_utterances_item_words_item.py +++ b/src/deepgram/types/listen_v1response_results_utterances_item_words_item.py @@ -11,7 +11,7 @@ class ListenV1ResponseResultsUtterancesItemWordsItem(UniversalBaseModel): start: typing.Optional[float] = None end: typing.Optional[float] = None confidence: typing.Optional[float] = None - speaker: typing.Optional[float] = None + speaker: typing.Optional[int] = None speaker_confidence: typing.Optional[float] = None punctuated_word: typing.Optional[str] = None