Scott Cogan commited on
Commit
32d0c27
·
1 Parent(s): d688122

fix: pass tools as a dictionary to CodeAgent

Browse files
Files changed (1) hide show
  1. app.py +12 -1
app.py CHANGED
@@ -154,9 +154,20 @@ with open("prompts.yaml", 'r') as stream:
154
  raise
155
 
156
  # Create the agent with the templates
 
 
 
 
 
 
 
 
 
 
 
157
  agent = CodeAgent(
158
  model=model,
159
- tools=[final_answer, DuckDuckGoSearchTool(), calculate_min_price, extract_price_from_snippet, get_current_time_in_timezone],
160
  max_steps=15,
161
  verbosity_level=2,
162
  grammar=None,
 
154
  raise
155
 
156
  # Create the agent with the templates
157
+ tools = [
158
+ final_answer,
159
+ DuckDuckGoSearchTool(),
160
+ calculate_min_price,
161
+ extract_price_from_snippet,
162
+ get_current_time_in_timezone
163
+ ]
164
+
165
+ # Convert tools to a dictionary format that smolagents expects
166
+ tools_dict = {tool.name: tool for tool in tools}
167
+
168
  agent = CodeAgent(
169
  model=model,
170
+ tools=tools_dict, # Pass tools as a dictionary
171
  max_steps=15,
172
  verbosity_level=2,
173
  grammar=None,