diff --git a/deepgram/transcription.py b/deepgram/transcription.py index 7f641502..6caee1ef 100644 --- a/deepgram/transcription.py +++ b/deepgram/transcription.py @@ -316,7 +316,7 @@ async def finish(self) -> None: """Closes the connection to the Deepgram endpoint, waiting until ASR is complete on all submitted data.""" - self.send(b'') # Set message for "data is finished sending" + self.send(json.dumps({"type": "CloseStream"})) # Set message for "data is finished sending" while not self.done: await asyncio.sleep(0.1)