Optional metadata provider override. Callers should set
instance.Provider = providerToUse before invoking service methods
in multi-provider contexts. Falls back to the global default provider when unset.
Add a new attachment to a conversation detail. Handles validation, storage decision, thumbnail generation, and record creation.
The ID of the conversation detail
The attachment data and metadata
The AI agent (for limit overrides)
The AI model (for capability limits)
The current user context
Current attachment counts for validation
Optionalprovider: IMetadataProviderOptional per-request metadata provider for server isolation
The result with created attachment or error
Create an AttachmentContent reference for embedding in messages. Maps from entity to the content block type used in AI messages.
The attachment entity
The attachment content reference
Delete an attachment and its underlying storage.
The attachment ID
The current user context
Optionalprovider: IMetadataProviderOptional per-request metadata provider for server isolation
Whether deletion succeeded
Download file content from MJStorage as a Buffer.
The File entity ID
The current user context
Optionalprovider: IMetadataProviderOptional per-request metadata provider for server isolation
Buffer of file content, or null if unavailable
Get attachment data with content URL. For inline attachments, returns the base64 data URL. For MJStorage attachments, returns a pre-authenticated download URL.
The attachment entity
The current user context
Optionalprovider: IMetadataProviderOptional per-request metadata provider for server isolation
The attachment with content URL
Get all attachments for a conversation detail.
The conversation detail ID
The current user context
Optionalprovider: IMetadataProviderArray of attachment entities
Get attachments for multiple conversation details (batch load).
Array of conversation detail IDs
The current user context
Optionalprovider: IMetadataProviderMap of conversation detail ID to attachments
Get a pre-authenticated download URL for an MJStorage file.
The File entity ID
The current user context
Optionalprovider: IMetadataProviderOptional per-request metadata provider for server isolation
The download URL or null if unavailable
Service for managing conversation attachments. Handles validation, storage, thumbnails, and CRUD operations.