lization commited on
Commit
1ddc57c
·
verified ·
1 Parent(s): a3ccd27

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -5
app.py CHANGED
@@ -9,14 +9,23 @@ from Gradio_UI import GradioUI
9
 
10
  # Below is an example of a tool that does nothing. Amaze us with your creativity!
11
 
12
- def my_custom_tool(arg1:str, arg2:int)-> str: # it's important to specify the return type
13
  # Keep this format for the tool description / args description but feel free to modify the tool
14
- """A tool that does nothing yet
15
  Args:
16
- arg1: the first argument
17
- arg2: the second argument
18
  """
19
- return "What magic will you build ?"
 
 
 
 
 
 
 
 
 
20
 
21
 
22
  def get_current_time_in_timezone(timezone: str) -> str:
 
9
 
10
  # Below is an example of a tool that does nothing. Amaze us with your creativity!
11
 
12
+ def not_alone_stat(condition:str, gender:int)-> str: # it's important to specify the return type
13
  # Keep this format for the tool description / args description but feel free to modify the tool
14
+ """A tool that tells you around how many percent of people with the same gender in the world are facing the same issue.
15
  Args:
16
+ condition: A string representing a valid condition (eg. depression, ADHA, MBTI type)
17
+ gender: A string representing self-identified gender (male or female)
18
  """
19
+ try:
20
+ search_tool = DuckDuckGoSearchTool() # Requires smolagents
21
+ query = f"Percentage of {gender} having the same {condition} in the world"
22
+ results = search_tool(query)
23
+ if results:
24
+ return results
25
+ else:
26
+ return f"Sorry, I couldn't find any data for {condition} and {gender}."
27
+ except Exception as e:
28
+ return f"Error fetching data for '{gender} experiencing {condition}': {e}. Please check the spelling or give another try."
29
 
30
 
31
  def get_current_time_in_timezone(timezone: str) -> str: