sytse06 commited on
Commit
194d72a
·
verified ·
1 Parent(s): 93c6952

Update app.py

Browse files

Improved the docstring to guide the agent better.

Files changed (1) hide show
  1. app.py +10 -3
app.py CHANGED
@@ -21,12 +21,19 @@ def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return
21
 
22
  @tool
23
  def get_temperature(location: str, temp_scale: str = "celsius") -> tuple[float, str]:
24
- """A tool that fetches the current temperature for a given location.
25
  Args:
26
  location: The name of the city/location
27
  temp_scale: Temperature scale to use ('celsius' or 'fahrenheit')
28
- Returns:
29
- tuple: (temperature value as float, unit as string 'C' or 'F', qualitative description)
 
 
 
 
 
 
 
30
  """
31
  def get_description(temp_c: float) -> str:
32
  """Get qualitative description based on Celsius temperature"""
 
21
 
22
  @tool
23
  def get_temperature(location: str, temp_scale: str = "celsius") -> tuple[float, str]:
24
+ """A tool that fetches the current temperature and provides a qualitative description.
25
  Args:
26
  location: The name of the city/location
27
  temp_scale: Temperature scale to use ('celsius' or 'fahrenheit')
28
+ Returns:
29
+ tuple: A tuple containing:
30
+ - temperature (float): The numerical temperature value
31
+ - unit (str): The temperature unit ('C' or 'F')
32
+ - description (str): How the temperature feels (freezing/cold/mild/warm/hot)
33
+ Usage:
34
+ temp, unit, feel = get_temperature("Warsaw", "celsius")
35
+ Example output: (-2.4, 'C', 'freezing')
36
+ Formatted: "The current temperature in Warsaw is -2.4°C - it feels freezing"
37
  """
38
  def get_description(temp_c: float) -> str:
39
  """Get qualitative description based on Celsius temperature"""