Spaces:
Sleeping
Sleeping
Update agent.py
Browse files
agent.py
CHANGED
|
@@ -79,7 +79,7 @@ def CustomDuckDuckGoSearchTool(query: str) -> str:
|
|
| 79 |
except Exception as e:
|
| 80 |
print(f"Error in DuckDuckGoSearchTool: {e}")
|
| 81 |
return f"Search error: {e}"
|
| 82 |
-
|
| 83 |
|
| 84 |
@tool
|
| 85 |
def CustomVisitWebpageTool(query: str) -> str:
|
|
@@ -99,7 +99,7 @@ def CustomVisitWebpageTool(query: str) -> str:
|
|
| 99 |
except Exception as e:
|
| 100 |
print(f"Error in VisitWebpageTool: {e}")
|
| 101 |
return f"Webpage access error: {e}"
|
| 102 |
-
|
| 103 |
|
| 104 |
#=======Agent========#
|
| 105 |
hf_token = os.environ.get("HF_TOKEN")
|
|
@@ -113,8 +113,8 @@ agent = CodeAgent(
|
|
| 113 |
modulus,
|
| 114 |
search_tool,
|
| 115 |
web_search,
|
| 116 |
-
|
| 117 |
-
|
| 118 |
model = model,
|
| 119 |
add_base_tools=True,
|
| 120 |
planning_interval=3
|
|
|
|
| 79 |
except Exception as e:
|
| 80 |
print(f"Error in DuckDuckGoSearchTool: {e}")
|
| 81 |
return f"Search error: {e}"
|
| 82 |
+
|
| 83 |
|
| 84 |
@tool
|
| 85 |
def CustomVisitWebpageTool(query: str) -> str:
|
|
|
|
| 99 |
except Exception as e:
|
| 100 |
print(f"Error in VisitWebpageTool: {e}")
|
| 101 |
return f"Webpage access error: {e}"
|
| 102 |
+
|
| 103 |
|
| 104 |
#=======Agent========#
|
| 105 |
hf_token = os.environ.get("HF_TOKEN")
|
|
|
|
| 113 |
modulus,
|
| 114 |
search_tool,
|
| 115 |
web_search,
|
| 116 |
+
CustomDuckDuckGoSearchTool,
|
| 117 |
+
CustomVisitWebpageTool],
|
| 118 |
model = model,
|
| 119 |
add_base_tools=True,
|
| 120 |
planning_interval=3
|