uasername commited on
Commit
02356c8
·
verified ·
1 Parent(s): 36a2410

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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(text: str) -> AgentAudio:
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=text, lang='en')
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