Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds support for SpeechStarted #249

Merged
merged 1 commit into from
Mar 29, 2024

Conversation

GuerrillaCoder
Copy link

@GuerrillaCoder GuerrillaCoder commented Mar 25, 2024

I needed to use speech started event so I made an update with the event added

Summary by CodeRabbit

  • New Features
    • Introduced Voice Activity Detection (VAD) events to the live transcription service. Now, when speech is detected, a SpeechStarted event will be triggered if VAD events are enabled.
    • Added a new option VadEvents to enable or disable VAD events during live transcription.
  • Enhancements
    • Enhanced live transcription results to include a Type property, improving result interpretation.
  • Documentation
    • Updated documentation to include details on the new SpeechStarted event and VadEvents option.

Copy link
Contributor

coderabbitai bot commented Mar 25, 2024

Walkthrough

The update introduces support for the SpeechStarted event in the Deepgram .NET SDK, triggered when speech is detected in a live stream with the vad_events feature enabled. This enhancement involves adding a new event, updating interfaces, and introducing new models to handle the event data, streamlining the process for developers to utilize start-of-speech detection in their applications.

Changes

Files Change Summary
.../LiveTranscriptionClient.cs Added support for SpeechStarted event handling.
.../Interfaces/ILiveTranscriptionClient.cs Introduced SpeechStarted event.
.../Models/LiveTranscriptionOptions.cs Added VadEvents property.
.../Models/LiveTranscriptionResult.cs Added Type property.
.../Models/LiveTranscriptionSpeechStarted.cs
.../Models/SpeechStartedEventArgs.cs
Introduced classes for SpeechStarted event data.

Related issues

  • Issue deepgram/deepgram-dotnet-sdk#180: The changes directly address the request to add support for the SpeechStarted event via the vad_events feature, as outlined in the issue's description. This makes it a perfect candidate to be linked to the PR, providing a solution to the enhancement requested by the user.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 38ad5bd and 011c3c2.
Files selected for processing (6)
  • Deepgram/Clients/LiveTranscriptionClient.cs (3 hunks)
  • Deepgram/Interfaces/ILiveTranscriptionClient.cs (1 hunks)
  • Deepgram/Models/LiveTranscriptionOptions.cs (1 hunks)
  • Deepgram/Models/LiveTranscriptionResult.cs (1 hunks)
  • Deepgram/Models/LiveTranscriptionSpeechStarted.cs (1 hunks)
  • Deepgram/Models/SpeechStartedEventArgs.cs (1 hunks)
Files skipped from review due to trivial changes (1)
  • Deepgram/Models/LiveTranscriptionSpeechStarted.cs
Additional comments: 7
Deepgram/Models/SpeechStartedEventArgs.cs (1)
  • 16-16: Consider making the SpeechStarted property read-only to ensure the immutability of the event args. This can be achieved by removing the set; accessor if the property is only intended to be set during object construction.
Deepgram/Models/LiveTranscriptionResult.cs (1)
  • 54-55: The addition of the Type property is consistent with the context of the class and follows best practices for JSON property annotations.
Deepgram/Interfaces/ILiveTranscriptionClient.cs (1)
  • 31-34: The addition of the SpeechStarted event is well-documented and follows the naming conventions of existing events in the interface.
Deepgram/Models/LiveTranscriptionOptions.cs (1)
  • 251-252: The addition of the VadEvents property is consistent with the context of the class and follows best practices for JSON property annotations.
Deepgram/Clients/LiveTranscriptionClient.cs (3)
  • 14-14: The addition of the using Newtonsoft.Json.Linq; directive is necessary for the use of JObject in the message processing logic.
  • 59-62: The declaration of the SpeechStarted event is consistent with other events in the class, and the documentation clearly explains its purpose.
  • 273-298: The message processing logic for handling "SpeechStarted" type messages is implemented correctly. It uses JObject to parse the WebSocket message, checks for a "SpeechStarted" type, deserializes the message, and raises the SpeechStarted event appropriately.

@davidvonthenen
Copy link
Contributor

This looks good to me, but will need to take a look at this. Currently working on v4 stuff and we dont have an example that I can really quickly run this against or have a unit test for a quick check.

@davidvonthenen davidvonthenen merged commit b6b1670 into deepgram:release-v3 Mar 29, 2024
3 checks passed
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.

2 participants