Overview
TheAttachment class handles file attachments on messages, supporting various file types with automatic processing for text extraction, MIME type detection, and integration with FileStore for persistence.
Creating Attachments
From Raw Content
From File Path
From Data URLs
Key properties
string
required
Name of the file
bytes | str
File content as bytes or base64-encoded string
string
MIME type of the file (auto-detected if not provided)
Dict[str, Any]
Processed content and metadata (e.g., extracted text, image info)
string
Unique identifier when stored in FileStore
string
Path where file is stored in FileStore
Literal['pending', 'stored', 'failed']
default:"pending"
Current processing status
string
Auto-generated unique ID based on content hash