Email Protocol • AI Agent SDK

EmailProtocol: Protocol for email bots with inbox lifecycle management.

EmailProtocol

Defined in the protocols module.

AI Agent

Protocol for email bots with inbox lifecycle management.

Extends BotProtocol with email-specific capabilities like programmatic inbox creation, listing, and deletion.

This protocol is optional — only AgentMail-style bots that support API-based inbox management need to implement it. Traditional IMAP/SMTP bots (EmailBot) do not implement this.

Methods

Usage

python
# Check if a bot supports inbox management
    if isinstance(bot, EmailProtocol):
        inbox = await bot.create_inbox(domain="mycompany.com")
        print(f"Created: {inbox['email_address']}")

Source

View on GitHub

praisonaiagents/bots/protocols.py at line 1463