Skip to content

Text to speech engine

TextToSpeechEngine

Source code in griptape/engines/audio/text_to_speech_engine.py
@define
class TextToSpeechEngine:
    text_to_speech_driver: BaseTextToSpeechDriver = field(kw_only=True)

    def run(self, prompts: list[str], *args, **kwargs) -> AudioArtifact:
        return self.text_to_speech_driver.try_text_to_audio(prompts=prompts)

text_to_speech_driver: BaseTextToSpeechDriver = field(kw_only=True) class-attribute instance-attribute

run(prompts, *args, **kwargs)

Source code in griptape/engines/audio/text_to_speech_engine.py
def run(self, prompts: list[str], *args, **kwargs) -> AudioArtifact:
    return self.text_to_speech_driver.try_text_to_audio(prompts=prompts)