Alejandro Ardila
Fixed runtime errors.
6acdf38
Raw
History Blame Contribute Delete
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,)
@tool
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)