Skip to content

Commit

Permalink
Merge pull request #248 from pipecat-ai/aleix/deepgramstt-url
Browse files Browse the repository at this point in the history
services(deepgram): add url to DeepgramSTTService
  • Loading branch information
aconchillo authored Jun 22, 2024
2 parents dc64e57 + adf414e commit b62beab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Allow specifying a `DeepgramSTTService` url which allows using on-prem
Deepgram.

- Added new `FastAPIWebsocketTransport`. This is a new websocket transport that
can be integrated with FastAPI websockets.

Expand Down
3 changes: 2 additions & 1 deletion src/pipecat/services/deepgram.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ async def run_tts(self, text: str) -> AsyncGenerator[Frame, None]:
class DeepgramSTTService(AIService):
def __init__(self,
api_key: str,
url: str = "",
live_options: LiveOptions = LiveOptions(
encoding="linear16",
language="en-US",
Expand All @@ -104,7 +105,7 @@ def __init__(self,
self._live_options = live_options

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.on(LiveTranscriptionEvents.Transcript, self._on_message)

Expand Down

0 comments on commit b62beab

Please sign in to comment.