Skip to content

Commit

Permalink
fix ELEVEN_LABS_IMPORT issue
Browse files Browse the repository at this point in the history
  • Loading branch information
shhlife committed Oct 31, 2024
1 parent 104bd77 commit 02a0740
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions nodes/tasks/gtUITextToSpeechTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
from .gtUIBaseTask import gtUIBaseTask

default_prompt = "{{ input_string }}"
settings = GriptapeSettings()
ELEVEN_LABS_API_KEY = settings.get_settings_key_or_use_env("ELEVEN_LABS_API_KEY")


class gtUITextToSpeechTask(gtUIBaseTask):
Expand All @@ -42,6 +40,11 @@ def run(self, **kwargs):
agent = kwargs.get("agent", None)
driver = kwargs.get("driver", None)
if not driver:
settings = GriptapeSettings()
ELEVEN_LABS_API_KEY = settings.get_settings_key_or_use_env(
"ELEVEN_LABS_API_KEY"
)

driver = agent.drivers_config.text_to_speech_driver
if isinstance(driver, DummyTextToSpeechDriver):
driver = ElevenLabsTextToSpeechDriver(
Expand Down

0 comments on commit 02a0740

Please sign in to comment.