services(deepgram): keep conenction alive
This commit is contained in:
@@ -25,6 +25,7 @@ from pipecat.services.ai_services import AIService, TTSService
|
|||||||
|
|
||||||
from deepgram import (
|
from deepgram import (
|
||||||
DeepgramClient,
|
DeepgramClient,
|
||||||
|
DeepgramClientOptions,
|
||||||
LiveTranscriptionEvents,
|
LiveTranscriptionEvents,
|
||||||
LiveOptions,
|
LiveOptions,
|
||||||
)
|
)
|
||||||
@@ -92,7 +93,8 @@ class DeepgramSTTService(AIService):
|
|||||||
|
|
||||||
self._live_options = live_options
|
self._live_options = live_options
|
||||||
|
|
||||||
self._client = DeepgramClient(api_key)
|
self._client = DeepgramClient(
|
||||||
|
api_key, config=DeepgramClientOptions(options={"keepalive": "true"}))
|
||||||
self._connection = self._client.listen.asynclive.v("1")
|
self._connection = self._client.listen.asynclive.v("1")
|
||||||
self._connection.on(LiveTranscriptionEvents.Transcript, self._on_message)
|
self._connection.on(LiveTranscriptionEvents.Transcript, self._on_message)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user