Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/ajar98/vocode-python into a…
Browse files Browse the repository at this point in the history
…dd-cartesia-tts
  • Loading branch information
rjheeta committed Jun 8, 2024
2 parents ed75d47 + cfd6226 commit c86c9a7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 54 deletions.
21 changes: 14 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,20 @@ homepage = "https://github.com/vocodedev/vocode-python"


[tool.poetry.dependencies]
python = ">=3.10,<4.0"
aiohttp = "^3.9.5"
anthropic = "^0.28.0"
azure-cognitiveservices-speech = "^1.37.0"
cartesia = "^0.1.1"
elevenlabs = "^1.2.2"
fastapi = "^0.111.0"
python = ">=3.8.1,<3.12"
pydub = "^0.25.1"
nltk = "^3.8.1"
openai = "^0.27.8"
sounddevice = "^0.4.6"
azure-cognitiveservices-speech = "^1.27.0"
websockets = "^11.0.2"
requests = "^2.28.2"
uvicorn = "^0.21.1"
fastapi = "^0.100.1"
jinja2 = "^3.1.2"
python-multipart = "^0.0.6"
six = "^1.16.0"
opentelemetry-sdk = "^1.17.0"
janus = "^1.0.0"
jinja2 = "^3.1.4"
jsonschema = "^4.22.0"
Expand Down
47 changes: 0 additions & 47 deletions vocode/streaming/synthesizer/default_factory.py
Original file line number Diff line number Diff line change
@@ -1,47 +0,0 @@
from typing import Type
from vocode.streaming.models.synthesizer import (
AzureSynthesizerConfig,
CartesiaSynthesizerConfig,
ElevenLabsSynthesizerConfig,
PlayHtSynthesizerConfig,
RimeSynthesizerConfig,
StreamElementsSynthesizerConfig,
SynthesizerConfig,
)
from vocode.streaming.synthesizer.abstract_factory import AbstractSynthesizerFactory
from vocode.streaming.synthesizer.azure_synthesizer import AzureSynthesizer
from vocode.streaming.synthesizer.base_synthesizer import BaseSynthesizer
from vocode.streaming.synthesizer.cartesia_synthesizer import CartesiaSynthesizer
from vocode.streaming.synthesizer.eleven_labs_synthesizer import ElevenLabsSynthesizer
from vocode.streaming.synthesizer.eleven_labs_websocket_synthesizer import ElevenLabsWSSynthesizer
from vocode.streaming.synthesizer.play_ht_synthesizer import PlayHtSynthesizer
from vocode.streaming.synthesizer.play_ht_synthesizer_v2 import PlayHtSynthesizerV2
from vocode.streaming.synthesizer.rime_synthesizer import RimeSynthesizer
from vocode.streaming.synthesizer.stream_elements_synthesizer import StreamElementsSynthesizer


class DefaultSynthesizerFactory(AbstractSynthesizerFactory):
def create_synthesizer(
self,
synthesizer_config: SynthesizerConfig,
):
if isinstance(synthesizer_config, AzureSynthesizerConfig):
return AzureSynthesizer(synthesizer_config)
elif isinstance(synthesizer_config, CartesiaSynthesizerConfig):
return CartesiaSynthesizer(synthesizer_config)
elif isinstance(synthesizer_config, ElevenLabsSynthesizerConfig):
eleven_labs_synthesizer_class_type: Type[BaseSynthesizer] = ElevenLabsSynthesizer
if synthesizer_config.experimental_websocket:
eleven_labs_synthesizer_class_type = ElevenLabsWSSynthesizer
return eleven_labs_synthesizer_class_type(synthesizer_config)
elif isinstance(synthesizer_config, PlayHtSynthesizerConfig):
if synthesizer_config.version == "2":
return PlayHtSynthesizerV2(synthesizer_config)
else:
return PlayHtSynthesizer(synthesizer_config)
elif isinstance(synthesizer_config, RimeSynthesizerConfig):
return RimeSynthesizer(synthesizer_config)
elif isinstance(synthesizer_config, StreamElementsSynthesizerConfig):
return StreamElementsSynthesizer(synthesizer_config)
else:
raise Exception("Invalid synthesizer config")

0 comments on commit c86c9a7

Please sign in to comment.