Spaces:
Sleeping
Sleeping
change audio from tool
Browse files
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) ->
|
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 |
-
|
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:
|