Spaces:
Runtime error
Runtime error
Download agents/utils.py from Isics/agents_gaia: direct link, hf CLI and curl.
- Browser
- Download file 833 Bytes
-
https://huggingface.co/spaces/Isics/agents_gaia/resolve/main/agents/utils.py
- Command line
-
hf download hf://spaces/Isics/agents_gaia/agents/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/Isics/agents_gaia/resolve/main/agents/utils.py
833 Bytes
| 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, | |
| ) | |