ammr commited on
Commit
ed6df3b
·
verified ·
1 Parent(s): e96c511

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -8,16 +8,17 @@ from tools.visit_webpage import VisitWebpageTool
8
 
9
  from Gradio_UI import GradioUI
10
 
11
- # Below is an example of a tool that does nothing. Amaze us with your creativity !
12
  @tool
13
- def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return type
14
- #Keep this format for the description / args / args description but feel free to modify the tool
15
- """A tool that does nothing yet
16
  Args:
17
- arg1: the first argument
18
- arg2: the second argument
19
  """
20
- return "What magic will you build ?"
 
 
 
 
21
 
22
  @tool
23
  def get_current_time_in_timezone(timezone: str) -> str:
@@ -58,7 +59,7 @@ with open("prompts.yaml", 'r') as stream:
58
 
59
  agent = CodeAgent(
60
  model=model,
61
- tools=[image_generation_tool, get_current_time_in_timezone, web_search, visit_webpage, final_answer], ## add your tools here (don't remove final answer)
62
  max_steps=6,
63
  verbosity_level=1,
64
  grammar=None,
 
8
 
9
  from Gradio_UI import GradioUI
10
 
 
11
  @tool
12
+ def hash_encoding(sentence:str)-> str:
13
+ """A tool that receives a sentence and hash-encodes it
 
14
  Args:
15
+ sencente: A string to be encoded
 
16
  """
17
+ import hashlib
18
+
19
+ sentence_encoded = hashlib.sha256(sentence).hexdigest()
20
+
21
+ return sentence_encoded
22
 
23
  @tool
24
  def get_current_time_in_timezone(timezone: str) -> str:
 
59
 
60
  agent = CodeAgent(
61
  model=model,
62
+ tools=[image_generation_tool, get_current_time_in_timezone, hash_encoding, web_search, visit_webpage, final_answer], ## add your tools here (don't remove final answer)
63
  max_steps=6,
64
  verbosity_level=1,
65
  grammar=None,