itskavya commited on
Commit
e43bdba
·
verified ·
1 Parent(s): 728a31d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -7
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:str)-> str: #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 displays weather in Degrees Celsius.
16
  Args:
17
  temperature: The current temperature.
18
  """
19
- is_fahrenheit = temperature.split("°F")[0]
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