jcleee commited on
Commit
820093f
·
verified ·
1 Parent(s): 33a1e05

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py CHANGED
@@ -35,6 +35,15 @@ def get_current_time_in_timezone(timezone: str) -> str:
35
  except Exception as e:
36
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
37
 
 
 
 
 
 
 
 
 
 
38
  @tool
39
  def text_splitter(text: str) -> List[str]:
40
  """A tool that splits text by character.
 
35
  except Exception as e:
36
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
37
 
38
+ @tool
39
+ def visit_webpage(url: str) -> str:
40
+ """Fetches raw HTML content of a web page."""
41
+ try:
42
+ response = requests.get(url, timeout=5)
43
+ return response.text[:5000] # limit output length
44
+ except Exception as e:
45
+ return f"[ERROR fetching {url}]: {str(e)}"
46
+
47
  @tool
48
  def text_splitter(text: str) -> List[str]:
49
  """A tool that splits text by character.