Spaces:
Runtime error
Runtime error
Scott Cogan commited on
Commit ·
c75b49f
1
Parent(s): bc9d42a
fix: pass tools as a dictionary to match template expectations
Browse files
app.py
CHANGED
|
@@ -190,17 +190,18 @@ class GetCurrentTimeInTimezoneTool(Tool):
|
|
| 190 |
except Exception as e:
|
| 191 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 192 |
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
|
|
|
| 200 |
|
| 201 |
agent = CodeAgent(
|
| 202 |
model=model,
|
| 203 |
-
tools=tools, # Pass tools as a
|
| 204 |
max_steps=15,
|
| 205 |
verbosity_level=2,
|
| 206 |
grammar=None,
|
|
|
|
| 190 |
except Exception as e:
|
| 191 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 192 |
|
| 193 |
+
# Create the agent with the templates
|
| 194 |
+
tools = {
|
| 195 |
+
"final_answer": final_answer,
|
| 196 |
+
"search": DuckDuckGoSearchTool(),
|
| 197 |
+
"calculate_min_price": CalculateMinPriceTool(),
|
| 198 |
+
"extract_price_from_snippet": ExtractPriceFromSnippetTool(),
|
| 199 |
+
"get_current_time_in_timezone": GetCurrentTimeInTimezoneTool()
|
| 200 |
+
}
|
| 201 |
|
| 202 |
agent = CodeAgent(
|
| 203 |
model=model,
|
| 204 |
+
tools=tools, # Pass tools as a dictionary
|
| 205 |
max_steps=15,
|
| 206 |
verbosity_level=2,
|
| 207 |
grammar=None,
|