Skip to content

Commit

Permalink
Fix #1048 (#1049)
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-XT authored Oct 12, 2023
1 parent d6d344c commit aafd914
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions agixt/extensions/voice_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,17 @@ def __init__(self, **kwargs):
if kwargs["USE_GTTS"].lower() == "true":
self.tts_command = "Speak with GTTS"
if "USE_HUGGINGFACE_TTS" in kwargs:
if (
kwargs["USE_HUGGINGFACE_TTS"].lower() == "true"
and "HUGGINGFACE_API_KEY" in kwargs
):
if kwargs["HUGGINGFACE_API_KEY"] != "":
self.tts_command = "Read Audio with Huggingface"
if isinstance(kwargs["USE_HUGGINGFACE_TTS"], bool):
if kwargs["USE_HUGGINGFACE_TTS"] and "HUGGINGFACE_API_KEY" in kwargs:
if kwargs["ELEVENLABS_API_KEY"] != "":
self.tts_command = "Read Audio with Huggingface"
else:
if (
kwargs["USE_HUGGINGFACE_TTS"].lower() == "true"
and "HUGGINGFACE_API_KEY" in kwargs
):
if kwargs["HUGGINGFACE_API_KEY"] != "":
self.tts_command = "Read Audio with Huggingface"
if "ELEVENLABS_API_KEY" in kwargs:
if kwargs["ELEVENLABS_API_KEY"] != "":
self.tts_command = "Speak with TTS Using Elevenlabs"
Expand Down

0 comments on commit aafd914

Please sign in to comment.