leogan commited on
Commit
5e96e12
·
verified ·
1 Parent(s): aa8e2b9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -9,18 +9,18 @@ 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 run_python_code_tool(arg1:str)-> 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 runs a small Python code.
15
  Args:
16
- arg1: the Python code as a string.
17
 
18
  Returns: result of the successfully executed code.
19
  """
20
  try:
21
- return eval(arg1)
22
  except Exception as e:
23
- return f"Error running '{}' code."
24
 
25
 
26
  @tool
 
9
 
10
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
11
  @tool
12
+ def run_python_code_tool(python_code_as_str:str)-> 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 runs a small Python code.
15
  Args:
16
+ python_code_as_str: the Python code as a string.
17
 
18
  Returns: result of the successfully executed code.
19
  """
20
  try:
21
+ return eval(python_code_as_str)
22
  except Exception as e:
23
+ return f"Error running '{python_code_as_str}' code."
24
 
25
 
26
  @tool