alamanna commited on
Commit
c792f80
·
verified ·
1 Parent(s): fb916e2

Update functionalities.py

Browse files
Files changed (1) hide show
  1. functionalities.py +14 -14
functionalities.py CHANGED
@@ -4,13 +4,11 @@ import requests
4
  @tool
5
  def suggest_outfit(occasion: str) -> str:
6
  """
7
- Suggests an outfit based on the occasion.
8
  Args:
9
- occasion (str): The type of occasion for the event. Allowed values are:
10
- - "casual": Outfit for casual event.
11
- - "formal": Outfit for formal event.
12
- - "active": Outfit for doing sport.
13
- - "custom": Custom outfit.
14
  """
15
  if occasion == "casual":
16
  return "T‑shirt, Jeans and sneakers."
@@ -24,11 +22,12 @@ def suggest_outfit(occasion: str) -> str:
24
  @tool
25
  def define_coordinates(city: str) -> dict:
26
  """
27
- Returns a dictionary with the geographical coordinates of a city.
28
  Args:
29
- city (str): A city name.
30
- Returns:
31
- A dictionary with the latitude, longitude and timezone of the city
 
32
  """
33
  city = city.strip()
34
  if not city:
@@ -43,11 +42,12 @@ def define_coordinates(city: str) -> dict:
43
  @tool
44
  def get_weather(city: str) -> dict:
45
  """
46
- Returns a dictionary with the current weather conditions in a city.
47
  Args:
48
- city (str): A city name.
49
- Returns:
50
- A dictionary with: temperature, wind_speed, weather_code, weather_description and a summary of the current weather.
 
51
  """
52
  coords = define_coordinates(city)
53
  if "error" in coords:
 
4
  @tool
5
  def suggest_outfit(occasion: str) -> str:
6
  """
7
+ Suggests an outfit based on the occasion type.
8
  Args:
9
+ occasion (str): One of "casual", "formal", "active", or "custom".
10
+ Returns:
11
+ str: A recommended outfit description suitable for the occasion.
 
 
12
  """
13
  if occasion == "casual":
14
  return "T‑shirt, Jeans and sneakers."
 
22
  @tool
23
  def define_coordinates(city: str) -> dict:
24
  """
25
+ Looks up geographic coordinates and timezone for a city.
26
  Args:
27
+ city (str): Name of the city to geocode.
28
+ Returns:
29
+ dict: Contains "latitude", "longitude", and "timezone",
30
+ or {"error": "..."} if lookup fails.
31
  """
32
  city = city.strip()
33
  if not city:
 
42
  @tool
43
  def get_weather(city: str) -> dict:
44
  """
45
+ Retrieves current weather (temp, wind, code, description) for a city.
46
  Args:
47
+ city (str): Name of the city to fetch weather for.
48
+ Returns:
49
+ dict: Keys include "temperature", "wind_speed", "weather_code",
50
+ "description", and "summary", or {"error": "..."} if failure.
51
  """
52
  coords = define_coordinates(city)
53
  if "error" in coords: