renwei2024 commited on
Commit
e26ac7d
·
verified ·
1 Parent(s): ac74b6c

Fix the AssertionError about count

Browse files

```
Traceback (most recent call last):
File "/home/user/app/app.py", line 29, in <module>
soccer_news_tool = SoccerNewsTool()
File "/usr/local/lib/python3.10/site-packages/smolagents/tools.py", line 68, in new_init
self.validate_arguments()
File "/usr/local/lib/python3.10/site-packages/smolagents/tools.py", line 184, in validate_arguments
assert "nullable" in value, (
AssertionError: Nullable argument 'count' in function signature should have key 'nullable' set to True in inputs.
```

Files changed (1) hide show
  1. tools.py +1 -0
tools.py CHANGED
@@ -67,6 +67,7 @@ class SoccerNewsTool(Tool):
67
  "count": {
68
  "type": "integer",
69
  "description": "How many headlines to return (1-20, default 5).",
 
70
  "default": 5,
71
  }
72
  }
 
67
  "count": {
68
  "type": "integer",
69
  "description": "How many headlines to return (1-20, default 5).",
70
+ "nullable": True,
71
  "default": 5,
72
  }
73
  }