Spaces:
Runtime error
Runtime error
Update basic_agent.py
Browse files- basic_agent.py +4 -0
basic_agent.py
CHANGED
|
@@ -11,6 +11,7 @@ class BasicAgent:
|
|
| 11 |
"analyze_youtube_video": (analyze_youtube_video, "url"),
|
| 12 |
"extract_number_from_text": (extract_number_from_text, "text"),
|
| 13 |
"search_wikipedia": (search_wikipedia, "query"),
|
|
|
|
| 14 |
}
|
| 15 |
|
| 16 |
def __call__(self, question: str) -> str:
|
|
@@ -32,6 +33,9 @@ class BasicAgent:
|
|
| 32 |
elif "wikipedia" in q or "encyclopedia" in q or "who is" in q:
|
| 33 |
return self.tool_registry["search_wikipedia"]
|
| 34 |
|
|
|
|
|
|
|
|
|
|
| 35 |
return self.tool_registry["extract_number_from_text"] # fallback
|
| 36 |
|
| 37 |
|
|
|
|
| 11 |
"analyze_youtube_video": (analyze_youtube_video, "url"),
|
| 12 |
"extract_number_from_text": (extract_number_from_text, "text"),
|
| 13 |
"search_wikipedia": (search_wikipedia, "query"),
|
| 14 |
+
"check_commutativity_table": (check_commutativity_table, "table_text"),
|
| 15 |
}
|
| 16 |
|
| 17 |
def __call__(self, question: str) -> str:
|
|
|
|
| 33 |
elif "wikipedia" in q or "encyclopedia" in q or "who is" in q:
|
| 34 |
return self.tool_registry["search_wikipedia"]
|
| 35 |
|
| 36 |
+
elif "commutative" in q or "counter-examples" in q:
|
| 37 |
+
return self.tool_registry["check_commutativity_table"]
|
| 38 |
+
|
| 39 |
return self.tool_registry["extract_number_from_text"] # fallback
|
| 40 |
|
| 41 |
|