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

@@ -8,6 +8,14 @@ from datetime import datetime, timezone
from typing import Any
@dataclass
class Attachment:
"""A text-extracted attachment from a user message."""
filename: str
content: str
@dataclass
class InboundMessage:
"""Message from a channel (user) heading to an agent."""
@@ -19,6 +27,7 @@ class InboundMessage:
target_agent: str | None = None
timestamp: datetime = field(default_factory=lambda: datetime.now(timezone.utc))
metadata: dict[str, Any] = field(default_factory=dict)
attachments: list[Attachment] = field(default_factory=list)
@dataclass