Liphos commited on
Commit
657b763
·
verified ·
1 Parent(s): 53e7165

change audio from tool

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -7,7 +7,7 @@ import pytz
7
  import yaml
8
  from tools.final_answer import FinalAnswerTool
9
 
10
- from Gradio_UI import GradioUI
11
 
12
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
13
  @tool
@@ -57,7 +57,7 @@ def play_audio_from_url(url):
57
  pygame.time.Clock().tick(10)
58
 
59
  @tool
60
- def play_preview_deezer(track: str, artist:str) -> str:
61
  """Play a preview of a track from Deezer.
62
  Args:
63
  track: The track to play.
@@ -88,7 +88,7 @@ def play_preview_deezer(track: str, artist:str) -> str:
88
  print(f"link: {first_track['link']}")
89
  # Play the track
90
  print("Playing preview: ", first_track['preview'])
91
- return first_track['preview']
92
  else:
93
  raise ValueError("No tracks found.")
94
  else:
 
7
  import yaml
8
  from tools.final_answer import FinalAnswerTool
9
 
10
+ from Gradio_UI import GradioUI, set_audio_url
11
 
12
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
13
  @tool
 
57
  pygame.time.Clock().tick(10)
58
 
59
  @tool
60
+ def play_preview_deezer(track: str, artist:str) -> None:
61
  """Play a preview of a track from Deezer.
62
  Args:
63
  track: The track to play.
 
88
  print(f"link: {first_track['link']}")
89
  # Play the track
90
  print("Playing preview: ", first_track['preview'])
91
+ set_audio_url(first_track['preview'])
92
  else:
93
  raise ValueError("No tracks found.")
94
  else: