Tools

Here are some example tools for LLM agents

from stringdale.tools import google_search,wikipedia_search,run_python_code

run_python_code

source

Signature: run_python_code(code: str)

Execute python code, useful when you need to do a calculation or a simple task Input should be a valid python code. If you want to see the output of a variable, the last line of the code should be that variable name.

Parameter Type Default Description
code <class ‘str’> None Python code to execute
:Returns: str - Output from executing the code, either the value of the last line or the error message
run_python_code('''
x=2
x*3
''')
6