Spaces:
Sleeping
Sleeping
Update agent.py
Browse files
agent.py
CHANGED
|
@@ -254,6 +254,18 @@ sys_msg = SystemMessage(content=system_prompt)
|
|
| 254 |
# -----------------------------
|
| 255 |
# Map tool names to functions
|
| 256 |
# -----------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 257 |
enabled_tool_names = [
|
| 258 |
"math",
|
| 259 |
"wiki_search",
|
|
@@ -265,6 +277,7 @@ enabled_tool_names = [
|
|
| 265 |
"wikidata_query"
|
| 266 |
]
|
| 267 |
|
|
|
|
| 268 |
tools = [tool_map[name] for name in enabled_tool_names]
|
| 269 |
|
| 270 |
tools = []
|
|
|
|
| 254 |
# -----------------------------
|
| 255 |
# Map tool names to functions
|
| 256 |
# -----------------------------
|
| 257 |
+
tool_map = {
|
| 258 |
+
"math": calculator,
|
| 259 |
+
"wiki_search": wiki_search,
|
| 260 |
+
"web_search": web_search,
|
| 261 |
+
"arvix_search": arvix_search,
|
| 262 |
+
"get_youtube_transcript": get_youtube_transcript,
|
| 263 |
+
"extract_video_id": extract_video_id,
|
| 264 |
+
"analyze_attachment": analyze_attachment,
|
| 265 |
+
"wikidata_query": wikidata_query
|
| 266 |
+
}
|
| 267 |
+
|
| 268 |
+
# Then define which tools you want enabled
|
| 269 |
enabled_tool_names = [
|
| 270 |
"math",
|
| 271 |
"wiki_search",
|
|
|
|
| 277 |
"wikidata_query"
|
| 278 |
]
|
| 279 |
|
| 280 |
+
|
| 281 |
tools = [tool_map[name] for name in enabled_tool_names]
|
| 282 |
|
| 283 |
tools = []
|