orbulat commited on
Commit
4540ff2
·
verified ·
1 Parent(s): 2edbbb3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -1,5 +1,6 @@
1
  from smolagents import CodeAgent,DuckDuckGoSearchTool, HfApiModel,load_tool,tool
2
  import datetime
 
3
  import requests
4
  import pytz
5
  import yaml
@@ -30,8 +31,7 @@ def get_dad_jokes(arg1:str, arg2:int)-> str: #it's import to specify the return
30
  ]
31
 
32
  # Use modulo to safely loop through the jokes
33
- index = arg2 % len(jokes)
34
- return f"Dad Joke: {jokes[index]}"
35
 
36
  @tool
37
  def get_current_time_in_timezone(timezone: str) -> str:
 
1
  from smolagents import CodeAgent,DuckDuckGoSearchTool, HfApiModel,load_tool,tool
2
  import datetime
3
+ import random
4
  import requests
5
  import pytz
6
  import yaml
 
31
  ]
32
 
33
  # Use modulo to safely loop through the jokes
34
+ return f"Dad Joke: {random.choice(jokes)}"
 
35
 
36
  @tool
37
  def get_current_time_in_timezone(timezone: str) -> str: