Spaces:
Configuration error
Configuration error
Download src/agent/tools/coding_tools.py from atejandro/agents-course-final-assignment: direct link, hf CLI and curl.
- Browser
- Download file 502 Bytes
-
https://huggingface.co/spaces/atejandro/agents-course-final-assignment/resolve/main/src/agent/tools/coding_tools.py
- Command line
-
hf download hf://spaces/atejandro/agents-course-final-assignment/src/agent/tools/coding_tools.py
-
curl -L -o coding_tools.py https://huggingface.co/spaces/atejandro/agents-course-final-assignment/resolve/main/src/agent/tools/coding_tools.py
502 Bytes
| from langchain_core.tools import tool | |
| from smolagents import CodeAgent, InferenceClientModel | |
| imports = ['datetime', 'pandas', 'numpy', 'python-chess', 'set', 'math'] | |
| agent = CodeAgent(tools=[], model=InferenceClientModel(), additional_authorized_imports=imports, max_steps=10,) | |
| def code_agent(question: str) -> str: | |
| """ | |
| A tool that can be used to code a solution to a problem. | |
| Args: | |
| question (str): The question to code a solution to. | |
| """ | |
| return agent.run(question) |