services: pass **kwargs to TTService
This commit is contained in:
@@ -35,8 +35,8 @@ except ModuleNotFoundError as e:
|
|||||||
|
|
||||||
|
|
||||||
class AzureTTSService(TTSService):
|
class AzureTTSService(TTSService):
|
||||||
def __init__(self, *, api_key, region, voice="en-US-SaraNeural"):
|
def __init__(self, *, api_key: str, region: str, voice="en-US-SaraNeural", **kwargs):
|
||||||
super().__init__()
|
super().__init__(**kwargs)
|
||||||
|
|
||||||
self.speech_config = SpeechConfig(subscription=api_key, region=region)
|
self.speech_config = SpeechConfig(subscription=api_key, region=region)
|
||||||
self.speech_synthesizer = SpeechSynthesizer(
|
self.speech_synthesizer = SpeechSynthesizer(
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
# SPDX-License-Identifier: BSD 2-Clause License
|
# SPDX-License-Identifier: BSD 2-Clause License
|
||||||
#
|
#
|
||||||
|
|
||||||
|
import aiohttp
|
||||||
|
|
||||||
from typing import AsyncGenerator
|
from typing import AsyncGenerator
|
||||||
|
|
||||||
from pipecat.frames.frames import AudioRawFrame, Frame
|
from pipecat.frames.frames import AudioRawFrame, Frame
|
||||||
@@ -17,10 +19,11 @@ class DeepgramTTSService(TTSService):
|
|||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
*,
|
*,
|
||||||
aiohttp_session,
|
aiohttp_session: aiohttp.ClientSession,
|
||||||
api_key,
|
api_key: str,
|
||||||
voice="alpha-asteria-en-v2"):
|
voice: str = "alpha-asteria-en-v2",
|
||||||
super().__init__()
|
**kwargs):
|
||||||
|
super().__init__(**kwargs)
|
||||||
|
|
||||||
self._voice = voice
|
self._voice = voice
|
||||||
self._api_key = api_key
|
self._api_key = api_key
|
||||||
|
|||||||
@@ -17,14 +17,14 @@ from loguru import logger
|
|||||||
class ElevenLabsTTSService(TTSService):
|
class ElevenLabsTTSService(TTSService):
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
*,
|
*,
|
||||||
aiohttp_session: aiohttp.ClientSession,
|
aiohttp_session: aiohttp.ClientSession,
|
||||||
api_key: str,
|
api_key: str,
|
||||||
voice_id: str,
|
voice_id: str,
|
||||||
model: str = "eleven_turbo_v2",
|
model: str = "eleven_turbo_v2",
|
||||||
):
|
**kwargs):
|
||||||
super().__init__()
|
super().__init__(**kwargs)
|
||||||
|
|
||||||
self._api_key = api_key
|
self._api_key = api_key
|
||||||
self._voice_id = voice_id
|
self._voice_id = voice_id
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ except ModuleNotFoundError as e:
|
|||||||
|
|
||||||
class PlayHTAIService(TTSService):
|
class PlayHTAIService(TTSService):
|
||||||
|
|
||||||
def __init__(self, *, api_key, user_id, voice_url):
|
def __init__(self, *, api_key: str, user_id: str, voice_url: str, **kwargs):
|
||||||
super().__init__()
|
super().__init__(**kwargs)
|
||||||
|
|
||||||
self._user_id = user_id
|
self._user_id = user_id
|
||||||
self._speech_key = api_key
|
self._speech_key = api_key
|
||||||
|
|||||||
Reference in New Issue
Block a user