Spaces:
Sleeping
Sleeping
Update agent.py
Browse files
agent.py
CHANGED
|
@@ -95,7 +95,7 @@ def CustomVisitWebpageTool(query: str) -> str:
|
|
| 95 |
soup = BeautifulSoup(response.text, 'html.parser')
|
| 96 |
# Extract text from the webpage
|
| 97 |
text = soup.get_text(separator=' ', strip=True)
|
| 98 |
-
return text[:
|
| 99 |
except Exception as e:
|
| 100 |
print(f"Error in VisitWebpageTool: {e}")
|
| 101 |
return f"Webpage access error: {e}"
|
|
|
|
| 95 |
soup = BeautifulSoup(response.text, 'html.parser')
|
| 96 |
# Extract text from the webpage
|
| 97 |
text = soup.get_text(separator=' ', strip=True)
|
| 98 |
+
return text[:100] # Limit output length to avoid overload
|
| 99 |
except Exception as e:
|
| 100 |
print(f"Error in VisitWebpageTool: {e}")
|
| 101 |
return f"Webpage access error: {e}"
|