Skip to content

Commit

Permalink
services: pass **kwargs to TTService
Browse files Browse the repository at this point in the history
  • Loading branch information
aconchillo committed May 15, 2024
1 parent 6247b9d commit 0b01eb5
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/pipecat/services/azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@


class AzureTTSService(TTSService):
def __init__(self, *, api_key, region, voice="en-US-SaraNeural"):
super().__init__()
def __init__(self, *, api_key: str, region: str, voice="en-US-SaraNeural", **kwargs):
super().__init__(**kwargs)

self.speech_config = SpeechConfig(subscription=api_key, region=region)
self.speech_synthesizer = SpeechSynthesizer(
Expand Down
11 changes: 7 additions & 4 deletions src/pipecat/services/deepgram.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# SPDX-License-Identifier: BSD 2-Clause License
#

import aiohttp

from typing import AsyncGenerator

from pipecat.frames.frames import AudioRawFrame, Frame
Expand All @@ -17,10 +19,11 @@ class DeepgramTTSService(TTSService):
def __init__(
self,
*,
aiohttp_session,
api_key,
voice="alpha-asteria-en-v2"):
super().__init__()
aiohttp_session: aiohttp.ClientSession,
api_key: str,
voice: str = "alpha-asteria-en-v2",
**kwargs):
super().__init__(**kwargs)

self._voice = voice
self._api_key = api_key
Expand Down
16 changes: 8 additions & 8 deletions src/pipecat/services/elevenlabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
class ElevenLabsTTSService(TTSService):

def __init__(
self,
*,
aiohttp_session: aiohttp.ClientSession,
api_key: str,
voice_id: str,
model: str = "eleven_turbo_v2",
):
super().__init__()
self,
*,
aiohttp_session: aiohttp.ClientSession,
api_key: str,
voice_id: str,
model: str = "eleven_turbo_v2",
**kwargs):
super().__init__(**kwargs)

self._api_key = api_key
self._voice_id = voice_id
Expand Down
4 changes: 2 additions & 2 deletions src/pipecat/services/playht.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

class PlayHTAIService(TTSService):

def __init__(self, *, api_key, user_id, voice_url):
super().__init__()
def __init__(self, *, api_key: str, user_id: str, voice_url: str, **kwargs):
super().__init__(**kwargs)

self._user_id = user_id
self._speech_key = api_key
Expand Down

0 comments on commit 0b01eb5

Please sign in to comment.