ronak008 commited on
Commit
988c780
·
verified ·
1 Parent(s): 9131bde

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -16
app.py CHANGED
@@ -9,7 +9,7 @@ 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 get_weather(city: str) -> str:
13
  """
14
  Fetches weather data for a given city using wttr.in and returns it as a formatted string.
15
 
@@ -19,21 +19,7 @@ def get_weather(city: str) -> str:
19
  Returns:
20
  str: Weather details including condition, temperature, humidity, and wind speed.
21
  """
22
- url = f"https://wttr.in/{city}?format=%C+%t+%h+%w"
23
-
24
- try:
25
- response = requests.get(url)
26
- if response.status_code == 200:
27
- weather_data = response.text.strip().split()
28
- if len(weather_data) == 4:
29
- condition, temp, humidity, wind = weather_data
30
- return f"Weather in {city}: Condition: {condition}, Temperature: {temp}, Humidity: {humidity}, Wind Speed: {wind}"
31
- else:
32
- return "Error: Unexpected weather data format."
33
- else:
34
- return f"Error: Unable to fetch weather data. Status code: {response.status_code}"
35
- except Exception as e:
36
- return f"Error: {e}"
37
 
38
  @tool
39
  def get_current_time_in_timezone(timezone: str) -> str:
 
9
 
10
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
11
  @tool
12
+ def my name(name: str) -> str:
13
  """
14
  Fetches weather data for a given city using wttr.in and returns it as a formatted string.
15
 
 
19
  Returns:
20
  str: Weather details including condition, temperature, humidity, and wind speed.
21
  """
22
+ return("My name is Rtuek")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
24
  @tool
25
  def get_current_time_in_timezone(timezone: str) -> str: