Update tools.py
Browse files
tools.py
CHANGED
|
@@ -96,7 +96,7 @@ def visit_webpage(url: str) -> str:
|
|
| 96 |
url: The URL to fetch.
|
| 97 |
|
| 98 |
Returns:
|
| 99 |
-
The main text content of the page, truncated to ~
|
| 100 |
"""
|
| 101 |
print(f"[TOOL] visit_webpage: {url}")
|
| 102 |
try:
|
|
@@ -108,7 +108,7 @@ def visit_webpage(url: str) -> str:
|
|
| 108 |
resp.raise_for_status()
|
| 109 |
text = markdownify.markdownify(resp.text, strip=["img", "script", "style"])
|
| 110 |
text = re.sub(r'\n{3,}', '\n\n', text).strip()
|
| 111 |
-
return text[:
|
| 112 |
except Exception as e:
|
| 113 |
print(f"[TOOL] visit_webpage error: {e}")
|
| 114 |
return f"Could not fetch {url}: {e}"
|
|
|
|
| 96 |
url: The URL to fetch.
|
| 97 |
|
| 98 |
Returns:
|
| 99 |
+
The main text content of the page, truncated to ~80k chars.
|
| 100 |
"""
|
| 101 |
print(f"[TOOL] visit_webpage: {url}")
|
| 102 |
try:
|
|
|
|
| 108 |
resp.raise_for_status()
|
| 109 |
text = markdownify.markdownify(resp.text, strip=["img", "script", "style"])
|
| 110 |
text = re.sub(r'\n{3,}', '\n\n', text).strip()
|
| 111 |
+
return text[:80_000]
|
| 112 |
except Exception as e:
|
| 113 |
print(f"[TOOL] visit_webpage error: {e}")
|
| 114 |
return f"Could not fetch {url}: {e}"
|