Integration
AutoGen Integration
Annotated tool functions with one-line registration for Microsoft AutoGen multi-agent conversations. register_tools() handles all wiring.
Quick Start
One function call registers all email tools with both the assistant and the user proxy. AutoGen handles the rest: tool schemas are injected into the assistant's system prompt, and the user proxy knows how to execute them.
from autogen import AssistantAgent, UserProxyAgent from deadsimple.integrations.autogen import register_tools assistant = AssistantAgent("email_agent", llm_config=llm_config) user_proxy = UserProxyAgent("user") register_tools(user_proxy, assistant, api_key="dse_your_api_key")
register_tools() registers all six email tools with the user proxy for execution and with the assistant for function calling. No manual schema writing required.
Available Tools
All tools are registered as annotated functions with type hints and docstrings that AutoGen converts into OpenAI-compatible tool schemas automatically.
| Tool | Description | Key Parameters |
|---|---|---|
send_email |
Send an email from an inbox | inbox_id, to, subject, body |
read_emails |
List recent messages in an inbox | inbox_id, limit |
read_email |
Get a single message by ID | inbox_id, message_id |
reply_to_email |
Reply to an existing message thread | inbox_id, message_id, body |
create_inbox |
Create a new email inbox | name |
list_inboxes |
List all inboxes on the account | None |
Full Example: Multi-Agent Email Workflow
A complete example with LLM configuration, agent setup, tool registration, and a conversation that demonstrates multi-step email operations.
import os from autogen import AssistantAgent, UserProxyAgent from deadsimple.integrations.autogen import register_tools # Configure the LLM llm_config = { "config_list": [ { "model": "gpt-4o", "api_key": os.environ["OPENAI_API_KEY"], } ], } # Create agents assistant = AssistantAgent( name="email_agent", system_message="You are an email assistant. Use the provided tools to manage inboxes and messages. Always confirm actions before proceeding.", llm_config=llm_config, ) user_proxy = UserProxyAgent( name="user", human_input_mode="NEVER", max_consecutive_auto_reply=10, code_execution_config=False, ) # Register all Dead Simple Email tools register_tools(user_proxy, assistant, api_key="dse_your_api_key") # Start the conversation user_proxy.initiate_chat( assistant, message="Create an inbox called 'notifications', then send a welcome email to team@example.com.", )
The assistant will call create_inbox first, then use the returned inbox ID to call send_email. AutoGen manages the multi-turn conversation loop, tool execution, and result passing between agents automatically.
Multi-Agent Patterns
AutoGen's strength is multi-agent collaboration. You can register Dead Simple Email tools with one agent and have others coordinate around it.
from autogen import AssistantAgent, UserProxyAgent, GroupChat, GroupChatManager from deadsimple.integrations.autogen import register_tools # Email specialist agent email_agent = AssistantAgent( name="email_agent", system_message="You handle all email operations. Send, read, and manage inboxes.", llm_config=llm_config, ) # Coordinator agent coordinator = AssistantAgent( name="coordinator", system_message="You coordinate tasks. Delegate email work to email_agent.", llm_config=llm_config, ) user_proxy = UserProxyAgent("user", human_input_mode="NEVER", code_execution_config=False) # Only the email agent gets the tools register_tools(user_proxy, email_agent, api_key="dse_your_api_key") # Group chat with both agents group_chat = GroupChat( agents=[user_proxy, coordinator, email_agent], messages=[], max_round=12, ) manager = GroupChatManager(groupchat=group_chat, llm_config=llm_config) user_proxy.initiate_chat( manager, message="Check the support inbox for new messages and summarize them.", )
The coordinator decides what needs to happen, the email agent executes email operations, and the user proxy handles tool execution. Each agent sees only what it needs.