File size: 384 Bytes
8847ce3
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
from smol_agent import SmolAgent

# Define the agent with a set of useful tools
tools = ["search", "calculator", "python", "code"]
agent = SmolAgent(tools=tools)

def run_agent(question: str) -> str:
    prompt = f"You are a helpful AI assistant. Answer the following question as clearly and accurately as possible:\n\n{question}"
    response = agent.run(prompt)
    return response