from smolagents import tool @tool def code_reader(python_file_path:str) -> str: """ This tool reads python file and returns the code as a string. Args: python_file_path: Path of a local python file that needs to be accessed. """ try: with open(python_file_path) as f: code = f.read() return code except Exception as e: return f'An unexpected error occurred: {str(e)}'