Isaac454 commited on
Commit
0b67d6c
·
verified ·
1 Parent(s): 8c5c24b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -0
app.py CHANGED
@@ -18,6 +18,28 @@ def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return
18
  """
19
  return "What magic will you build ?"
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  @tool
22
  def get_current_time_in_timezone(timezone: str) -> str:
23
  """A tool that fetches the current local time in a specified timezone.
 
18
  """
19
  return "What magic will you build ?"
20
 
21
+ @tool
22
+ def translate_english_to_french(text: str) -> str:
23
+ """
24
+ Translates English text into French.
25
+
26
+ Args:
27
+ text: English text to be translated.
28
+
29
+ Returns:
30
+ The translated French text.
31
+ """
32
+ prompt = f"""
33
+ Translate the following English text into French.
34
+ Only return the translated French text.
35
+
36
+ English:
37
+ {text}
38
+ """
39
+
40
+ return prompt
41
+
42
+
43
  @tool
44
  def get_current_time_in_timezone(timezone: str) -> str:
45
  """A tool that fetches the current local time in a specified timezone.