Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,22 +9,12 @@ from Gradio_UI import GradioUI
|
|
| 9 |
|
| 10 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 11 |
@tool
|
| 12 |
-
def
|
| 13 |
-
"""A tool
|
| 14 |
Args:
|
| 15 |
-
|
| 16 |
-
temp: the temperature amount
|
| 17 |
"""
|
| 18 |
-
|
| 19 |
-
return fahrenheit_to_celsius(temp)
|
| 20 |
-
if temp_unit == "celsius":
|
| 21 |
-
return fahrenheit_to_celsius(temp)
|
| 22 |
-
|
| 23 |
-
def celsius_to_fahrenheit(temp):
|
| 24 |
-
return (temp*(9/5))+32
|
| 25 |
-
|
| 26 |
-
def fahrenheit_to_celsius(temp):
|
| 27 |
-
return (temp-32)/(9/5)
|
| 28 |
|
| 29 |
|
| 30 |
@tool
|
|
|
|
| 9 |
|
| 10 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 11 |
@tool
|
| 12 |
+
def ddg_search(search:str)-> str: #it's import to specify the return type
|
| 13 |
+
"""A tool that searches the web with duckduckgo
|
| 14 |
Args:
|
| 15 |
+
search: the search term used in the duckduckgo search
|
|
|
|
| 16 |
"""
|
| 17 |
+
return DuckDuckGoSearchTool.forward(search)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
|
| 20 |
@tool
|