Spaces:
Sleeping
Sleeping
Update agent.py
Browse files
agent.py
CHANGED
|
@@ -254,20 +254,25 @@ sys_msg = SystemMessage(content=system_prompt)
|
|
| 254 |
# -----------------------------
|
| 255 |
# Map tool names to functions
|
| 256 |
# -----------------------------
|
| 257 |
-
|
| 258 |
-
"math"
|
| 259 |
-
"wiki_search"
|
| 260 |
-
"web_search"
|
| 261 |
-
"arvix_search"
|
| 262 |
-
"get_youtube_transcript"
|
| 263 |
-
"extract_video_id"
|
| 264 |
-
"analyze_attachment"
|
| 265 |
-
"wikidata_query"
|
| 266 |
-
|
| 267 |
-
}
|
| 268 |
|
| 269 |
tools = [tool_map[name] for name in enabled_tool_names]
|
| 270 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 271 |
|
| 272 |
# -------------------------------
|
| 273 |
# Step 2: Load the JSON file or tasks (Replace this part if you're loading tasks dynamically)
|
|
|
|
| 254 |
# -----------------------------
|
| 255 |
# Map tool names to functions
|
| 256 |
# -----------------------------
|
| 257 |
+
enabled_tool_names = [
|
| 258 |
+
"math",
|
| 259 |
+
"wiki_search",
|
| 260 |
+
"web_search",
|
| 261 |
+
"arvix_search",
|
| 262 |
+
"get_youtube_transcript",
|
| 263 |
+
"extract_video_id",
|
| 264 |
+
"analyze_attachment",
|
| 265 |
+
"wikidata_query"
|
| 266 |
+
]
|
|
|
|
| 267 |
|
| 268 |
tools = [tool_map[name] for name in enabled_tool_names]
|
| 269 |
|
| 270 |
+
tools = []
|
| 271 |
+
for name in enabled_tool_names:
|
| 272 |
+
if name in tool_map:
|
| 273 |
+
tools.append(tool_map[name])
|
| 274 |
+
else:
|
| 275 |
+
print(f"⚠️ Warning: Tool '{name}' not found in tool_map. Skipping.")
|
| 276 |
|
| 277 |
# -------------------------------
|
| 278 |
# Step 2: Load the JSON file or tasks (Replace this part if you're loading tasks dynamically)
|