AttachmentConfig
Defined in the config module.AI Agent Attachment/media ceilings for the gateway wire protocol (Issue #5207). The gateway is the control plane custom
/ws clients build on, but the
message frame had no attachment contract and no per-attachment size/type
policy — only the whole-frame max_payload. These ceilings are advertised
to clients in the hello handshake (folded into HelloResult.policy) so
a well-behaved client self-limits — inlining small files, chunking larger
ones at chunk_bytes — instead of discovering the limit by being
disconnected. All fields are advisory limits; enforcement lives wherever the
gateway materialises attachments (a wrapper/bot concern).
Backward-compatible: attachments are opt-in per turn, and a client that
never sends one is unaffected by these values.
Attributes:
max_attachment_bytes: Largest single attachment (inline or stored) the
gateway accepts, in bytes. Default 10 MiB.
max_attachments: Maximum number of attachments on one message turn.
chunk_bytes: Advertised chunk size a client should use when streaming a
large file into the attachment store (reserve → put chunk → close).
allowed_types: Optional allow-list of MIME types / prefixes (e.g.
image/ or application/pdf). Empty (default) means no type
restriction is advertised.
Properties
int
No description available.
int
No description available.
int
No description available.
List[str]
No description available.
Methods
enabled()
Whether the gateway advertises any attachment capacity.
to_policy()
Build the policy fragment advertised in
HelloResult.policy.Internal & Generic Methods
Internal & Generic Methods
- from_dict: Create from a parsed
gateway.attachmentsmapping (tolerant of None). - to_dict: Convert to dictionary.
Source
View on GitHub
praisonaiagents/gateway/config.py at line 847
