fix(types): change speaker and related fields from float to int#652
Merged
lukeocodes merged 1 commit intomainfrom Jan 29, 2026
Merged
fix(types): change speaker and related fields from float to int#652lukeocodes merged 1 commit intomainfrom
lukeocodes merged 1 commit intomainfrom
Conversation
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
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a type regression in the Deepgram SDK where speaker-related fields were incorrectly typed as float instead of int, causing downstream tools to display speaker IDs as "speaker 0.0" instead of "speaker 0".
Changes:
- Updated
speakerandchannelfields fromfloattointin utterance response types - Updated
speakerandnum_wordsfields fromfloattointin paragraph response types
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
listen_v1response_results_utterances_item_words_item.py |
Changed speaker field type from float to int |
listen_v1response_results_utterances_item.py |
Changed speaker and channel field types from float to int |
listen_v1response_results_channels_item_alternatives_item_paragraphs_paragraphs_item.py |
Changed speaker and num_words field types from float to int |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
naomi-deepgram
approved these changes
Jan 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #641
Changed speaker, channel, and num_words fields from
floattointin Listen V1 response types to match the actual API response format.Issue
In SDK v5, the speaker field was incorrectly defined as
float, causing subtitle generation tools likedeepgram-captionsto display speakers as "speaker 0.0", "speaker 1.0" instead of "speaker 0", "speaker 1". This is a regression from SDK v4.8.Changes
Modified the following type definition files:
listen_v1response_results_utterances_item.py- Changedspeakerandchannelfromfloattointlisten_v1response_results_utterances_item_words_item.py- Changedspeakerfromfloattointlisten_v1response_results_channels_item_alternatives_item_paragraphs_paragraphs_item.py- Changedspeakerandnum_wordsfromfloattointTest plan