Spaces:
Runtime error
Runtime error
| import pandas as pd | |
| from smolagents import CodeAgent, Model, tool, SpeechToTextTool | |
| from config import authorized_libraries | |
| def reverse_string(string: str) -> str: | |
| """ | |
| Given a string and return it reversed. | |
| For example, given "siht dnatsrednu uoy fI" will return "If you understand this" | |
| Args: | |
| string (str): String to reverse | |
| """ | |
| return string[::-1] | |
| def create_utils(model: Model) -> CodeAgent: | |
| return CodeAgent( | |
| model=model, | |
| tools=[ | |
| reverse_string, | |
| SpeechToTextTool(), | |
| ], | |
| add_base_tools=True, | |
| additional_authorized_imports=authorized_libraries, | |
| name="utils_manager", | |
| description="Have a bunch of useful utilities, like functions to reverse string.", | |
| verbosity_level=0, | |
| max_steps=8, | |
| ) | |