Upload agent (2).py
Browse files- agent (2).py +10 -0
agent (2).py
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from smol_agent import SmolAgent
|
2 |
+
|
3 |
+
# Define the agent with a set of useful tools
|
4 |
+
tools = ["search", "calculator", "python", "code"]
|
5 |
+
agent = SmolAgent(tools=tools)
|
6 |
+
|
7 |
+
def run_agent(question: str) -> str:
|
8 |
+
prompt = f"You are a helpful AI assistant. Answer the following question as clearly and accurately as possible:\n\n{question}"
|
9 |
+
response = agent.run(prompt)
|
10 |
+
return response
|