person9601 commited on
Commit
1bef7c7
·
verified ·
1 Parent(s): b3e1315

change back to city, what am i missing here to do i need to describe argument "city" somehwere

Browse files

Runtime error
Exit code: 1. Reason: Traceback (most recent call last): File "/home/user/app/app.py", line 32, in <module> def my_custom_get_weather_info(city: str) -> str: File "/usr/local/lib/python3.10/site-packages/smolagents/tools.py", line 845, in tool tool_json_schema = get_json_schema(tool_function)["function"] File "/usr/local/lib/python3.10/site-packages/smolagents/_function_type_hints_utils.py", line 207, in get_json_schema raise DocstringParsingException( smolagents._function_type_hints_utils.DocstringParsingException: Cannot generate JSON schema for my_custom_get_weather_info because the docstring has no description for the argument 'city'

Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -29,7 +29,7 @@ load_dotenv()
29
  # arg2: the second argument
30
  # """
31
  # return "What magic will you build ?"
32
- def my_custom_get_weather_info(q: str) -> str:
33
  """A tool that fetches current weather information for a specified city.
34
  Args:
35
  location: City name or location (e.g., 'New York', 'London,UK', 'London,ON', 'London,Canada')
@@ -46,7 +46,7 @@ def my_custom_get_weather_info(q: str) -> str:
46
 
47
  params = {
48
  "key": api_key,
49
- "q": q,
50
  }
51
 
52
  response = requests.get(base_url, params=params)
 
29
  # arg2: the second argument
30
  # """
31
  # return "What magic will you build ?"
32
+ def my_custom_get_weather_info(city: str) -> str:
33
  """A tool that fetches current weather information for a specified city.
34
  Args:
35
  location: City name or location (e.g., 'New York', 'London,UK', 'London,ON', 'London,Canada')
 
46
 
47
  params = {
48
  "key": api_key,
49
+ "q": city,
50
  }
51
 
52
  response = requests.get(base_url, params=params)