OlivierZ commited on
Commit
b064a22
·
verified ·
1 Parent(s): a6d8036

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -11
app.py CHANGED
@@ -9,22 +9,25 @@ 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(number1: int, number2: int) -> str:
13
- """A tool that multiplies two integer inputs and returns the result as a string.
14
  Args:
15
- number1: The first integer to multiply.
16
- number2: The second integer to multiply.
17
  """
18
- result = number1 * number2
19
- return str(result)
 
 
 
20
 
21
- # Example usage (not part of the tool definition itself)
22
  if __name__ == "__main__":
23
- output = multiply_tool(arg1=5, arg2=10)
24
- print(f"The result of the multiplication is: {output}")
25
 
26
- output_negative = multiply_tool(arg1=-3, arg2=7)
27
- print(f"The result of the multiplication is: {output_negative}")
28
 
29
 
30
  @tool
 
9
 
10
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
11
  @tool
12
+ def poem_tool(word1: str, word2: str) -> str:
13
+ """A tool that creates a short, simple poem using two input words.
14
  Args:
15
+ word1: The first word to include in the poem.
16
+ word2: The second word to include in the poem.
17
  """
18
+ poem = f"The {word1} softly sighs,\n"
19
+ poem += f"Beneath the moonlit skies.\n"
20
+ poem += f"A gentle breeze then flows,\n"
21
+ poem += f"Where the {word2} gently grows."
22
+ return poem
23
 
24
+ # Example usage:
25
  if __name__ == "__main__":
26
+ output_poem = poem_tool(word1="shadow", word2="flower")
27
+ print(output_poem)
28
 
29
+ output_another_poem = poem_tool(word1="ocean", word2="dream")
30
+ print(output_another_poem)
31
 
32
 
33
  @tool