services(deepgram): add url to DeepgramSTTService
This commit is contained in:
@@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
|
- Allow specifying a `DeepgramSTTService` url which allows using on-prem
|
||||||
|
Deepgram.
|
||||||
|
|
||||||
- Added new `FastAPIWebsocketTransport`. This is a new websocket transport that
|
- Added new `FastAPIWebsocketTransport`. This is a new websocket transport that
|
||||||
can be integrated with FastAPI websockets.
|
can be integrated with FastAPI websockets.
|
||||||
|
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ class DeepgramTTSService(TTSService):
|
|||||||
class DeepgramSTTService(AIService):
|
class DeepgramSTTService(AIService):
|
||||||
def __init__(self,
|
def __init__(self,
|
||||||
api_key: str,
|
api_key: str,
|
||||||
|
url: str = "",
|
||||||
live_options: LiveOptions = LiveOptions(
|
live_options: LiveOptions = LiveOptions(
|
||||||
encoding="linear16",
|
encoding="linear16",
|
||||||
language="en-US",
|
language="en-US",
|
||||||
@@ -104,7 +105,7 @@ class DeepgramSTTService(AIService):
|
|||||||
self._live_options = live_options
|
self._live_options = live_options
|
||||||
|
|
||||||
self._client = DeepgramClient(
|
self._client = DeepgramClient(
|
||||||
api_key, config=DeepgramClientOptions(options={"keepalive": "true"}))
|
api_key, config=DeepgramClientOptions(url=url, 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