teff.tool.builtin.web_fetch¶
teff.tool.builtin.web_fetch
¶
Web fetch tool — download a URL and extract its text content.
Classes:
| Name | Description |
|---|---|
WebFetchTool |
Fetch a URL and return the page's text content. |
WebFetchTool
¶
Bases: Tool
Fetch a URL and return the page's text content.
Uses httpx (a core dependency) for the request and
beautifulsoup4 (from teff[tools]) to strip markup.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict | None
|
Optional dict with |
None
|
timeout
|
float
|
Request timeout in seconds (default 15). |
15.0
|
user_agent
|
str
|
User-Agent header sent with the request (default "teff"). |
'teff'
|
Source code in teff/tool/builtin/web_fetch.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | |