AutoGen integration
dial-autogen packages Dial’s operations as Microsoft AutoGen
tools, so an AssistantAgent can send messages, receive OTP codes, and place calls as part of its
work. It’s the AutoGen sibling of the LangChain integration: each
tool is an autogen_core.tools.FunctionTool wrapping the Python SDK
client — it adds nothing to the REST contract, it just shapes Dial’s operations into AutoGen tools.
Targeting Microsoft’s newer Agent Framework (the 1.0 successor to AutoGen + Semantic Kernel)
instead? Use dial-agentframework. Both expose the same Dial
tools; pick the one that matches your stack.
Install
This pulls in dial-sdk and autogen-agentchat.
Give the tools to an agent
Build one DialClient, pass it to dial_tools, and hand
the list to an agent. Every tool shares that one client — a single connection pool for the
whole agent session — and you own its lifecycle (await client.close() when done).
Enterprise / Azure AI builds typically drive AutoGen with an Azure OpenAI model client:
dial_tools returns the full set, all sharing your client — the analog of LangChain’s
DialToolkit.get_tools(). AutoGen runs tools in an async loop, so the Dial tools are
async-native — there’s no async→sync bridge (the one difference from the
CrewAI sibling).
Available tools
Each builder takes your shared DialClient and returns one FunctionTool:
Or pick individual tools
Handling OTP
The reason an agent needs phone identity: receive a verification code and act on it.
wait_for_message blocks until the next inbound SMS arrives, so an agent can trigger a
signup that texts a code to your Dial number, read the code, and enter it back into the form.
A full runnable example is in examples/signup_autogen.ipynb.
send_message is a write action and isn’t idempotent — a re-invoke after a failure can
send a duplicate. make_call accepts an idempotency_key. See
Retries and idempotency.
Receiving events beyond a single wait
wait_for_message is a one-shot wait, backed by a presence-based stream (not
at-least-once — missed events replay only on reconnect within ~2 minutes). To react to
inbound SMS or completed calls durably, use the Python SDK’s
new_events_connection() directly, or register a webhook
(signed and retried at-least-once), and feed events into your agent however suits your app.