Microsoft Agent Framework integration
dial-agentframework packages Dial’s operations as Microsoft Agent Framework
tools, so an Agent can send messages, receive OTP codes, and place calls as part of its work.
The Agent Framework is Microsoft’s production successor to AutoGen and Semantic Kernel — the path
for new Azure / enterprise agent builds. It’s a sibling of the
LangChain integration: each tool is an agent_framework.FunctionTool
wrapping the Python SDK client — it adds nothing to the REST contract,
it just shapes Dial’s operations into Agent Framework tools.
Already on the original AutoGen (autogen-agentchat)? Use
dial-autogen. Both expose the same Dial tools.
Install
This pulls in dial-sdk and agent-framework-core. The Agent Framework keeps each model
provider in its own package, so also install a chat client for your provider — for example
agent-framework-openai, or the framework’s Azure integration for Azure OpenAI.
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):
dial_tools returns the full set, all sharing your client — the analog of LangChain’s
DialToolkit.get_tools(). The Agent Framework runs tools in an async loop, so the Dial
tools are async-native — no async→sync bridge. The Dial tools themselves are identical
regardless of which model provider (Azure OpenAI, OpenAI, …) drives the agent.
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_agentframework.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.