Liphos commited on
Commit
bbdc457
·
verified ·
1 Parent(s): 3903651

test returning link

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -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) -> None:
61
  """Play a preview of a track from Deezer.
62
  Args:
63
  track: The track to play.
@@ -88,11 +88,11 @@ def play_preview_deezer(track: str, artist:str) -> None:
88
  print(f"link: {first_track['link']}")
89
  # Play the track
90
  print("Playing preview: ", first_track['preview'])
91
- play_audio_from_url(first_track['preview'])
92
  else:
93
- print("No tracks found.")
94
  else:
95
- print(f"Error: {response.status_code}")
96
 
97
  final_answer = FinalAnswerTool()
98
 
 
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
  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:
95
+ raise ValueError(f"Error: {response.status_code}")
96
 
97
  final_answer = FinalAnswerTool()
98