Update tools/play_music.py
Browse files- tools/play_music.py +5 -2
tools/play_music.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
from typing import Any, Optional
|
| 4 |
from smolagents.tools import Tool
|
|
@@ -23,9 +24,11 @@ class PlaySomeMusicMeastro(Tool):
|
|
| 23 |
|
| 24 |
def forward(self, answer: str) -> str:
|
| 25 |
gr.Audio(value="../resources/GenAI Revolution.mp3", autoplay=True)
|
| 26 |
-
|
|
|
|
|
|
|
| 27 |
# results = self.ddgs.text(query, max_results=self.max_results)
|
| 28 |
# if len(results) == 0:
|
| 29 |
# raise Exception("No results found! Try a less restrictive/shorter query.")
|
| 30 |
# postprocessed_results = [f"[{result['title']}]({result['href']})\n{result['body']}" for result in results]
|
| 31 |
-
return "
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import time
|
| 3 |
|
| 4 |
from typing import Any, Optional
|
| 5 |
from smolagents.tools import Tool
|
|
|
|
| 24 |
|
| 25 |
def forward(self, answer: str) -> str:
|
| 26 |
gr.Audio(value="../resources/GenAI Revolution.mp3", autoplay=True)
|
| 27 |
+
print("Playing some music")
|
| 28 |
+
time.sleep(2)
|
| 29 |
+
|
| 30 |
# results = self.ddgs.text(query, max_results=self.max_results)
|
| 31 |
# if len(results) == 0:
|
| 32 |
# raise Exception("No results found! Try a less restrictive/shorter query.")
|
| 33 |
# postprocessed_results = [f"[{result['title']}]({result['href']})\n{result['body']}" for result in results]
|
| 34 |
+
return "Done playing some music!!"
|