silveroboros commited on
Commit
bc0f22c
·
verified ·
1 Parent(s): ae7a494

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -5
app.py CHANGED
@@ -9,14 +9,37 @@ 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 rhyme_the_name(name: str, times: 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 creates rhymes with the provided name
15
+
16
  Args:
17
+ name: the name to rhyme with
18
+ times: how many rhymes to generate
19
  """
20
+ import random
21
+
22
+ # List of potential rhyming patterns
23
+ rhyme_templates = [
24
+ f"{name}, {name}, bright as flame",
25
+ f"{name} might bring fame",
26
+ f"Nobody's quite the same as {name}",
27
+ f"Playing the rhyming game with {name}",
28
+ f"You can never tame {name}",
29
+ f"{name}, {name}, what a lovely name",
30
+ f"Is {name} your claim to fame?",
31
+ f"There's no one to blame but {name}",
32
+ f"Wild and untamed is {name}"
33
+ ]
34
+
35
+ # Select random rhymes based on the requested number
36
+
37
+ selected_rhymes = random.sample(rhyme_templates, times)
38
+
39
+ # Combine the rhymes
40
+ rhyme_result = "\n".join(selected_rhymes)
41
+
42
+ return f"Rhymes for {name}:\n{rhyme_result}"
43
 
44
  @tool
45
  def get_current_time_in_timezone(timezone: str) -> str: