Skip to content

Conversation

@lukeocodes
Copy link
Contributor

Summary

Fixes #641

Changed speaker, channel, and num_words fields from float to int in 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 like deepgram-captions to 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:

  1. listen_v1response_results_utterances_item.py - Changed speaker and channel from float to int
  2. listen_v1response_results_utterances_item_words_item.py - Changed speaker from float to int
  3. listen_v1response_results_channels_item_alternatives_item_paragraphs_paragraphs_item.py - Changed speaker and num_words from float to int

Test plan

  • Verify that speaker IDs are now returned as integers (0, 1, 2) instead of floats (0.0, 1.0, 2.0)
  • Test with deepgram-captions package to ensure subtitles display "speaker 0" format
  • Ensure backward compatibility with existing code

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
Copilot AI review requested due to automatic review settings January 29, 2026 21:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 speaker and channel fields from float to int in utterance response types
  • Updated speaker and num_words fields from float to int in 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.

@lukeocodes lukeocodes merged commit 00ee485 into main Jan 29, 2026
13 checks passed
@lukeocodes lukeocodes deleted the fix/speaker-field-type-to-int branch January 29, 2026 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ListenV1ResponseResultsUtterancesItem.speaker defined as float

3 participants