CrewAI integration
dial-crewai packages Dial’s operations as CrewAI tools, so a
multi-agent crew can send messages, receive OTP codes, and place calls as part of its
work. It’s the CrewAI sibling of the LangChain integration:
each tool is a crewai.tools.BaseTool subclass wrapping the Python SDK
client — it adds nothing to the REST contract, it just shapes Dial’s operations into
CrewAI tools.
Install
This pulls in dial-sdk and crewai.
Give the tools to a crew
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 crew:
dial_tools returns the full set, all sharing your client — the analog of LangChain’s
DialToolkit.get_tools(). CrewAI agents take a plain tools=[...] list.
Available tools
Each tool takes your shared DialClient (client=):
Or pick individual tools
Handling OTP
The reason a crew needs phone identity: receive a verification code and act on it.
WaitForMessageTool 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_crew.py.
The dial-sdk client is async; these tools are sync-first (_run) with an async→sync
bridge, and also expose _arun for async crews. SendMessageTool is a write action and
isn’t idempotent — a re-invoke after a failure can send a duplicate. MakeCallTool
accepts an idempotency_key. See Retries and idempotency.
Receiving events beyond a single wait
WaitForMessageTool 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 crew however suits your app.