Update app.py
Browse filesadd wiki search tool
app.py
CHANGED
|
@@ -16,6 +16,12 @@ from string import Template
|
|
| 16 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
| 17 |
|
| 18 |
# --- tools ---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
web_search = DuckDuckGoSearchTool()
|
| 20 |
visit_webpage = VisitWebpageTool()
|
| 21 |
final_answer = FinalAnswerTool()
|
|
@@ -88,7 +94,7 @@ class EnhancedAgent:
|
|
| 88 |
self.model_id = "Qwen/Qwen3-235B-A22B-Thinking-2507"
|
| 89 |
self.provider = "auto"
|
| 90 |
self.timeout = 360
|
| 91 |
-
self.tools = [
|
| 92 |
self.auth_imports = ["pandas", "numpy", "datetime", "json", "re", "math", "os", "requests", "csv", "urllib"]
|
| 93 |
self.max_steps = 5
|
| 94 |
self.agent = CodeAgent(
|
|
|
|
| 16 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
| 17 |
|
| 18 |
# --- tools ---
|
| 19 |
+
wiki_search = WikipediaSearchTool(
|
| 20 |
+
user_agent=f"HF_Agents_Final_Assignment ({os.getenv('USER_EMAIL')})",
|
| 21 |
+
language="en",
|
| 22 |
+
content_type="text",
|
| 23 |
+
extract_format="WIKI",
|
| 24 |
+
)
|
| 25 |
web_search = DuckDuckGoSearchTool()
|
| 26 |
visit_webpage = VisitWebpageTool()
|
| 27 |
final_answer = FinalAnswerTool()
|
|
|
|
| 94 |
self.model_id = "Qwen/Qwen3-235B-A22B-Thinking-2507"
|
| 95 |
self.provider = "auto"
|
| 96 |
self.timeout = 360
|
| 97 |
+
self.tools = [wiki_search, web_search, visit_webpage, read_file_as_text, reverse_string, final_answer]
|
| 98 |
self.auth_imports = ["pandas", "numpy", "datetime", "json", "re", "math", "os", "requests", "csv", "urllib"]
|
| 99 |
self.max_steps = 5
|
| 100 |
self.agent = CodeAgent(
|