aw_agents.agents.download¶
Download Agent - Smart content downloader with context-aware naming.
Functions
|
Convenience function to download a single URL and return the path. |
Classes
|
Smart download agent with context-aware naming and intelligent link handling. |
|
Core download engine with smart link handling and context-aware naming. |
- class aw_agents.agents.download.DownloadAgent(default_download_dir=None, **kwargs)[source]¶
Bases:
AgentBaseSmart download agent with context-aware naming and intelligent link handling.
Features:
Detects landing pages and finds actual download links
Special handling for GitHub, HuggingFace, Kaggle
Context-aware file naming
Multiple content type support
>>> agent = DownloadAgent() >>> tools = agent.get_tools() >>> len(tools) >= 3 True
- class aw_agents.agents.download.DownloadEngine(default_download_dir=None, *, user_agent='DownloadAgent/1.0', timeout=30, max_redirects=5, extension_router=None)[source]¶
Bases:
objectCore download engine with smart link handling and context-aware naming.
>>> engine = DownloadEngine() >>> # engine.download("https://example.com/paper.pdf", context="Important ML Paper")- download(url, *, context=None, download_dir=None, filename=None, force_redownload=False)[source]¶
Download content from a URL with smart handling.
- Parameters:
url (
str) – URL to download fromcontext (
Optional[str]) – Context about the content (used for filename generation)download_dir (
Union[str,Path,None]) – Directory to download to (default: self.default_download_dir)filename (
Optional[str]) – Override automatic filename generationforce_redownload (
bool) – Force re-download even if cached
- Returns:
‘path’: Path to downloaded file
’url’: Final URL downloaded from
’warnings’: List of warning messages
’metadata’: Additional metadata
- Return type:
Example
>>> engine = DownloadEngine() >>> # result = engine.download("https://example.com/paper.pdf", context="ML Paper") >>> # print(result['path'])
- aw_agents.agents.download.download_content(url, *, context=None, download_dir=None)[source]¶
Convenience function to download a single URL and return the path.
Example
>>> # path = download_content("https://example.com/file.pdf", context="Important doc")- Return type:
Modules
Download Agent - Smart content downloader with context-aware naming. |
|
Download Agent: Smart content downloader with context-aware naming and intelligent link handling. |