Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -59,7 +59,7 @@ 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:
|
|
@@ -69,7 +69,7 @@ def text_to_speech(text: str) -> AgentAudio:
|
|
| 69 |
An audio response.
|
| 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(response_text: str) -> AgentAudio:
|
| 63 |
"""Converts input text to speech and returns an AgentAudio instance with the audio file path.
|
| 64 |
|
| 65 |
Args:
|
|
|
|
| 69 |
An audio response.
|
| 70 |
|
| 71 |
"""
|
| 72 |
+
tts = gTTS(text=response_text, lang='en')
|
| 73 |
tts.save(AUDIO_OUTPUT_PATH)
|
| 74 |
return AgentAudio(AUDIO_OUTPUT_PATH)
|
| 75 |
|