Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -28,9 +28,21 @@ class BasicAgent:
|
|
| 28 |
temperature=0.2,
|
| 29 |
)
|
| 30 |
|
|
|
|
|
|
|
|
|
|
| 31 |
# Add tools
|
| 32 |
tools = [DuckDuckGoSearchTool()]
|
| 33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
# Create smolagents CodeAgent
|
| 35 |
self.agent = CodeAgent(tools=tools, model=llm)
|
| 36 |
|
|
|
|
| 28 |
temperature=0.2,
|
| 29 |
)
|
| 30 |
|
| 31 |
+
answer = llm("Who won the 2024 Olympic gold in swimming?")
|
| 32 |
+
print(answer)
|
| 33 |
+
|
| 34 |
# Add tools
|
| 35 |
tools = [DuckDuckGoSearchTool()]
|
| 36 |
|
| 37 |
+
query = "Who won the 2024 Olympic gold in swimming?"
|
| 38 |
+
|
| 39 |
+
try:
|
| 40 |
+
result = tools.run(query)
|
| 41 |
+
print("Search output:", result)
|
| 42 |
+
except Exception as e:
|
| 43 |
+
print("DuckDuckGoSearchTool error:", e)
|
| 44 |
+
|
| 45 |
+
|
| 46 |
# Create smolagents CodeAgent
|
| 47 |
self.agent = CodeAgent(tools=tools, model=llm)
|
| 48 |
|