#Do you provide close in stt sdk?

1 messages · Page 1 of 1 (latest)

next estuary
#

Do you provide close method in deepgram stt sdk ?

sudden rainBOT
#

Hi @next estuary. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Yes, Deepgram provides methods to close streaming connections in its Speech-to-Text SDKs across different programming languages.

For the JavaScript/Node.js SDK:

For closing streams in other languages:

In Python:

  • You can send a close message using await close_websocket(ws) where the function sends a JSON message with {"type": "CloseStream"} Python Code Samples.

In .NET:

  • The SDK provides a Stop() method that signals to Deepgram that you've finished streaming audio and it should conclude transcription .NET SDK Streaming Transcription.

In JavaScript with WebSockets:

  • You can send a JSON message with {"type": "CloseStream"} to close the connection Close Stream.

The CloseStream message instructs the server to finish processing any cached data, send the final response along with summary metadata, and then terminate the WebSocket connection gracefully Close Stream Conclusion.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@next estuary Kapa.ai is still learning and improving, please let me know how I did by reacting below.

next estuary
#

@sudden rain I was wondering if live streaming stt has close() method such as dgConnection.close()

sudden rainBOT
#

Let me check the knowledge base for you again. One moment! :books:

#

Based on the knowledge sources, Deepgram's SDKs provide different methods for closing live streaming STT connections, but the exact method name varies by language/SDK:

In the Python SDK, the method is called finish():

dg_connection.finish()

Live Streaming Audio Transcription

In the Node.js/JavaScript SDK, the method is called requestClose():

live.requestClose();

Node SDK Streaming Transcription

If you're using lower-level WebSockets directly (without an SDK), you would send a JSON message with the CloseStream type:

dgLiveObj.send(JSON.stringify({ 'type': 'CloseStream' }));

Close Stream

There isn't a specific close() method mentioned in the documentation, but each SDK provides its own equivalent function for closing the connection. The exact method name depends on which SDK or approach you're using to connect to Deepgram's streaming STT service.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: