nickzf commited on
Commit
698b334
·
verified ·
1 Parent(s): f5d1023

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -6
app.py CHANGED
@@ -9,14 +9,32 @@ from Gradio_UI import GradioUI
9
 
10
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
11
  @tool
12
- def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return type
13
- #Keep this format for the description / args / 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
  @tool
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
  @tool
12
+ def find_club(interest: str) -> str:
13
+ """Finds a QIU club or society based on a student's interest.
 
14
  Args:
15
+ interest: A keyword representing the student's interest (e.g., 'tech', 'sports', 'arts').
 
16
  """
17
+ interest = interest.lower()
18
+ clubs = {
19
+ "tech": ["Dev Collective (QIU Student Chapter)"],
20
+ "sports": ["QIU Football Club", "QIU Badminton Club", "QIU Basketball Club"],
21
+ "arts": ["QIU Art Space", "QIU Dance Club"],
22
+ "community": ["QIU Event Planning Club", "Environmental Awareness Club"],
23
+ "business": ["Entrepreneurship Club", "Finance Society"],
24
+ "gaming": ["QIU eSports Club", "QIU Indoor Club"],
25
+
26
+ }
27
+
28
+ matches = []
29
+ for keyword, matching_clubs in clubs.items():
30
+ if keyword in interest:
31
+ matches.extend(matching_clubs)
32
+
33
+ if matches:
34
+ return f"Based on your interest in '{interest}', you might like: {', '.join(matches)}."
35
+ else:
36
+ return "Sorry, no clubs matched your interest. Try different keywords like 'tech', 'sports', 'arts', 'gaming', or 'community'."
37
+
38
 
39
  @tool
40
  def get_current_time_in_timezone(timezone: str) -> str: