Spaces:
Runtime error
Runtime error
Scott Cogan commited on
Commit ·
18ec0f7
1
Parent(s): ad6ada3
fix: wrap tools in Tool objects with name and description attributes
Browse files
app.py
CHANGED
|
@@ -155,16 +155,16 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 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 |
agent = CodeAgent(
|
| 166 |
model=model,
|
| 167 |
-
tools=tools, # Pass tools as a list
|
| 168 |
max_steps=15,
|
| 169 |
verbosity_level=2,
|
| 170 |
grammar=None,
|
|
|
|
| 155 |
|
| 156 |
# Create the agent with the templates
|
| 157 |
tools = [
|
| 158 |
+
Tool(name="final_answer", description="Submit the final answer to the question", func=final_answer),
|
| 159 |
+
Tool(name="search", description="Search the web for information", func=DuckDuckGoSearchTool()),
|
| 160 |
+
Tool(name="calculate_min_price", description="Calculate the minimum price from a list of prices", func=calculate_min_price),
|
| 161 |
+
Tool(name="extract_price_from_snippet", description="Extract prices from a text snippet", func=extract_price_from_snippet),
|
| 162 |
+
Tool(name="get_current_time_in_timezone", description="Get the current time in a specified timezone", func=get_current_time_in_timezone)
|
| 163 |
]
|
| 164 |
|
| 165 |
agent = CodeAgent(
|
| 166 |
model=model,
|
| 167 |
+
tools=tools, # Pass tools as a list of Tool objects
|
| 168 |
max_steps=15,
|
| 169 |
verbosity_level=2,
|
| 170 |
grammar=None,
|