dianamclean commited on
Commit
0339850
·
verified ·
1 Parent(s): de4dcbd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -14
app.py CHANGED
@@ -33,22 +33,20 @@ def get_current_time_in_timezone(timezone: str) -> str:
33
  except Exception as e:
34
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
35
 
36
- def my_ai_joke(arg1: str) -> str: # it's import to specify the return type
37
- # Keep this format for the description / args / args description but feel free to modify the tool
38
- """A tool that tells an AI joke about agents and humans working together
 
 
39
  Args:
40
- arg1: A string representing the setup for the joke. For example, "Why did the AI cross the road?"
 
41
  """
42
-
43
- if not arg1:
44
- return "Why did the AI cross the road? ... To get to the other dataset!"
45
- elif "why did the ai" in arg1.lower():
46
- return f"{arg1}... Because it had a better algorithm to get there!"
47
- elif "human" in arg1.lower() and "ai" in arg1.lower():
48
- return f"{arg1} ... They make a great team: the human brings the creativity and the AI brings the execution... and sometimes a random error message!"
49
- else:
50
- return "Why did the AI refuse to work with the human? ... It said they had too many 'bugs' in their thinking!"
51
-
52
 
53
  final_answer = FinalAnswerTool()
54
 
 
33
  except Exception as e:
34
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
35
 
36
+ # Below is my attempt to use the structure provided
37
+ @tool
38
+ def my_cutom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return type
39
+ #Keep this format for the description / args / args description but feel free to modify the tool
40
+ """A tool that does nothing yet
41
  Args:
42
+ arg1: the first argument
43
+ arg2: the second argument
44
  """
45
+ if arg2 > 10:
46
+ joke = arg1 #return a joke about arg1
47
+ else
48
+ joke = "What magic will you build ?"
49
+ return joke
 
 
 
 
 
50
 
51
  final_answer = FinalAnswerTool()
52