Spaces:
Configuration error
Configuration error
| 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) |