Skip to content

Conversation

jkroll-deepgram
Copy link
Contributor

Support the KeepAlive feature to keep a websocket open for an additional 12 seconds without sending additional streaming audio data.

Basic usage:

deepgram = Deepgram(DEEPGRAM_API_KEY)
deepgramLive = await deepgram.transcription.live(PARAMS)
deepgramLive.keep_alive()

Copy link
Contributor

@jjmaldonis jjmaldonis left a comment

Choose a reason for hiding this comment

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

Looks good to me!

At some point it might be worth adding functionality to send this keep-alive automatically until the user manually closes the websocket connection. However, that would require an additional task/thread running at all times for each websocket to keep track of when the last message was sent to the websocket.

@jkroll-deepgram jkroll-deepgram merged commit c0f06da into deepgram:main Aug 3, 2023
@jkroll-deepgram jkroll-deepgram deleted the add-keepalive branch August 3, 2023 19:30
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