Skip to main content

Official Dial tools for the Microsoft Agent Framework — phone numbers, SMS, OTP, and voice calls

Project description

dial-agentframework

Official Dial tools for the Microsoft Agent Framework — give a ChatAgent the ability to send SMS, receive OTP codes, and place AI voice calls through Dial. Agents automating signups and web tasks get a real phone identity.

It's the Agent Framework sibling of dial-langchain and dial-crewai: each tool is an agent_framework.FunctionTool (built with the tool decorator) wrapping the dial-sdk client. It adds nothing to the REST contract — it just shapes Dial's operations into Agent Framework tools.

Targeting the original AutoGen (autogen-agentchat) instead? Use dial-autogen.

Install

pip install dial-agentframework

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 — e.g. agent-framework-openai (below) or, for Azure OpenAI, the framework's Azure integration.

Give the tools to an agent

Build one DialClient, pass it to dial_tools, and hand the result 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):

from agent_framework import Agent
from agent_framework.openai import OpenAIChatClient  # pip install agent-framework-openai
from dial_sdk import DialClient, DialConfig
from dial_agentframework import dial_tools

dial = DialClient(DialConfig(api_key="sk_live_..."))  # close with `await dial.close()`

agent = Agent(
    OpenAIChatClient(),  # or an Azure OpenAI client for enterprise/Azure deployments
    name="phone_agent",
    instructions="You operate the team's Dial phone number for SMS, OTP, and voice calls.",
    tools=dial_tools(dial),
)

result = await agent.run("Text +14155550123 from pn_abc saying our table is ready.")
print(result.text)

DialConfig also takes an optional base_url to target a non-default deployment.

Azure OpenAI: install the framework's Azure integration and swap in its Azure OpenAI chat client — the Dial tools are identical regardless of which provider drives the agent.

Or pick individual tools

Each builder returns one AIFunction:

from dial_agentframework import send_message_tool, wait_for_message_tool

tools = [
    send_message_tool(dial),
    wait_for_message_tool(dial),
]

Available tools

Each builder takes your shared DialClient:

Builder Tool name Action
list_numbers_tool list_numbers List your phone numbers
purchase_number_tool purchase_number Provision a new number (billable)
set_number_properties_tool set_number_properties Update a number's nickname / inbound instruction
send_message_tool send_message Send an SMS (optionally MMS)
list_messages_tool list_messages List recent messages
make_call_tool make_call Place an AI voice call
list_calls_tool list_calls List recent calls
get_call_tool get_call Fetch one call by id
get_billing_tool get_billing Credit balance, subscription, per-number mode
wait_for_message_tool wait_for_message Block until the next inbound SMS arrives, or time out

OTP flow

The point of phone identity for an agent: send a code and read the reply. wait_for_message blocks until the next inbound SMS arrives, so an agent can:

  1. trigger a signup that texts a code to your Dial number,
  2. call wait_for_message to read the inbound code,
  3. enter it back into the signup form.

See examples/signup_agentframework.ipynb for a runnable agent.

Notes

  • The Agent Framework runs tools in an async loop, so these tools are async-native — no async→sync bridge.
  • 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.
  • wait_for_message is backed by Dial's presence-based event stream — for durable, at-least-once delivery, register a webhook.

See the Microsoft Agent Framework integration docs for the full guide.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dial_agentframework-0.10.0.tar.gz (89.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dial_agentframework-0.10.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file dial_agentframework-0.10.0.tar.gz.

File metadata

  • Download URL: dial_agentframework-0.10.0.tar.gz
  • Upload date:
  • Size: 89.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dial_agentframework-0.10.0.tar.gz
Algorithm Hash digest
SHA256 fe09b01cbfc9e693c1b7c3e1051ea4147064ac08bf69678f0fee3019942a08c9
MD5 30948f2eb7708b4a1f34acf19d03483c
BLAKE2b-256 b90b7e2b447c4725dfd08064523c3362b25d319de9489931db5b8f107096e434

See more details on using hashes here.

Provenance

The following attestation bundles were made for dial_agentframework-0.10.0.tar.gz:

Publisher: publish-sdk-agentframework.yml on GENWAY-AI/dial

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dial_agentframework-0.10.0-py3-none-any.whl.

File metadata

File hashes

Hashes for dial_agentframework-0.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a1739aeb1627ba1e7376bf70c1af461f2f38b34e76d8c234836f918729fb18ed
MD5 79afea8e2bb53e0e51f61e22631c773e
BLAKE2b-256 ce849d8111b7aa43adb0620f2d90b96aa0e4939802d6f7236abc74939d399513

See more details on using hashes here.

Provenance

The following attestation bundles were made for dial_agentframework-0.10.0-py3-none-any.whl:

Publisher: publish-sdk-agentframework.yml on GENWAY-AI/dial

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page