Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -59,17 +59,17 @@ def lookup_definition(query: str) -> AgentText:
|
|
| 59 |
AUDIO_OUTPUT_PATH = "/tmp/response.mp3"
|
| 60 |
|
| 61 |
@tool
|
| 62 |
-
def text_to_speech(
|
| 63 |
"""Converts input text to speech and returns an AgentAudio instance with the audio file path.
|
| 64 |
|
| 65 |
Args:
|
| 66 |
-
|
| 67 |
-
|
| 68 |
Returns:
|
| 69 |
-
An audio
|
| 70 |
-
|
| 71 |
"""
|
| 72 |
-
tts = gTTS(text=
|
| 73 |
tts.save(AUDIO_OUTPUT_PATH)
|
| 74 |
return AgentAudio(AUDIO_OUTPUT_PATH)
|
| 75 |
|
|
|
|
| 59 |
AUDIO_OUTPUT_PATH = "/tmp/response.mp3"
|
| 60 |
|
| 61 |
@tool
|
| 62 |
+
def text_to_speech(text: str) -> AgentAudio:
|
| 63 |
"""Converts input text to speech and returns an AgentAudio instance with the audio file path.
|
| 64 |
|
| 65 |
Args:
|
| 66 |
+
text (str): The text that will be converted into speech.
|
| 67 |
+
|
| 68 |
Returns:
|
| 69 |
+
AgentAudio: An AgentAudio instance containing the file path to the generated audio.
|
| 70 |
+
|
| 71 |
"""
|
| 72 |
+
tts = gTTS(text=text, lang='en')
|
| 73 |
tts.save(AUDIO_OUTPUT_PATH)
|
| 74 |
return AgentAudio(AUDIO_OUTPUT_PATH)
|
| 75 |
|