2MoOn24mOoN4 commited on
Commit
137a035
·
verified ·
1 Parent(s): 8a242a8

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +5 -2
agent.py CHANGED
@@ -65,8 +65,10 @@ def process_tool_output(tool_output):
65
  return str(tool_output)
66
 
67
  class CustomDuckDuckGoSearchTool(Tool):
 
 
68
  def __call__(self, query: str) -> str:
69
- """Perform a DuckDuckGo search and return a string result."""
70
  try:
71
  with DDGS() as ddgs:
72
  results = list(ddgs.text(query, max_results=3)) # Convert generator to list
@@ -77,8 +79,9 @@ class CustomDuckDuckGoSearchTool(Tool):
77
  custome_duck_search = CustomDuckDuckGoSearchTool()
78
 
79
  class CustomVisitWebpageTool(Tool):
 
 
80
  def __call__(self, url: str) -> str:
81
- """Visit a webpage and extract content as a string."""
82
  try:
83
  response = requests.get(url, timeout=10)
84
  response.raise_for_status()
 
65
  return str(tool_output)
66
 
67
  class CustomDuckDuckGoSearchTool(Tool):
68
+ name = "CustomDuckDuckGoSearchTool"
69
+ description = "Perform a DuckDuckGo search and return a string result."
70
  def __call__(self, query: str) -> str:
71
+
72
  try:
73
  with DDGS() as ddgs:
74
  results = list(ddgs.text(query, max_results=3)) # Convert generator to list
 
79
  custome_duck_search = CustomDuckDuckGoSearchTool()
80
 
81
  class CustomVisitWebpageTool(Tool):
82
+ name = "CustomVisitWebpageTool"
83
+ description = "Visit a webpage and extract content as a string."
84
  def __call__(self, url: str) -> str:
 
85
  try:
86
  response = requests.get(url, timeout=10)
87
  response.raise_for_status()