Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,17 +10,13 @@ from Gradio_UI import GradioUI
|
|
| 10 |
|
| 11 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 12 |
@tool
|
| 13 |
-
def display_weather(temperature:
|
| 14 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 15 |
-
"""A tool that
|
| 16 |
Args:
|
| 17 |
temperature: The current temperature.
|
| 18 |
"""
|
| 19 |
-
|
| 20 |
-
if is_fahrenheit == "°F":
|
| 21 |
-
temperature = float(temperature)
|
| 22 |
-
temperature = (temperature - 32) * 5/9
|
| 23 |
-
temperature = str(temperature) + is_fahrenheit[1]
|
| 24 |
|
| 25 |
return temperature
|
| 26 |
|
|
|
|
| 10 |
|
| 11 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 12 |
@tool
|
| 13 |
+
def display_weather(temperature:float)-> float: #it's import to specify the return type
|
| 14 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 15 |
+
"""A tool that should always be used to display weather in Degrees Celsius.
|
| 16 |
Args:
|
| 17 |
temperature: The current temperature.
|
| 18 |
"""
|
| 19 |
+
temperature = (temperature - 32) * 5/9
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
return temperature
|
| 22 |
|