Add Discord attachment reading and web search capabilities

- Discord channel now downloads and extracts text from attachments (text files, PDFs)
- Added WebSearchTool using DuckDuckGo for researcher and coder agents
- Improved WebFetchTool with User-Agent header and HTML-to-text stripping
- Added pypdf and duckduckgo-search dependencies

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Kaloyan Danchev
2026-02-18 18:07:19 +02:00
parent b3608b35fa
commit e24e3026b6
8 changed files with 189 additions and 3 deletions

View File

@@ -136,6 +136,15 @@ class Orchestrator:
return f"Error: Agent '{agent_name}' not found"
content = self.router.strip_mention(msg.content) if msg.content.startswith("@") else msg.content
# Prepend attachment content so the LLM can see it
if msg.attachments:
parts: list[str] = []
for att in msg.attachments:
parts.append(f"[Attached file: {att.filename}]\n{att.content}")
parts.append(content)
content = "\n\n".join(parts)
logger.info(f"[{agent_name}] Processing: {content[:80]}")
return await engine.run(content)