dial-agentframework 0.19.2__tar.gz → 0.20.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dial_agentframework-0.19.2 → dial_agentframework-0.20.0}/PKG-INFO +1 -1
- {dial_agentframework-0.19.2 → dial_agentframework-0.20.0}/dial_agentframework/tools.py +14 -3
- {dial_agentframework-0.19.2 → dial_agentframework-0.20.0}/pyproject.toml +1 -1
- {dial_agentframework-0.19.2 → dial_agentframework-0.20.0}/tests/test_tools.py +29 -0
- {dial_agentframework-0.19.2 → dial_agentframework-0.20.0}/uv.lock +2 -2
- {dial_agentframework-0.19.2 → dial_agentframework-0.20.0}/.gitignore +0 -0
- {dial_agentframework-0.19.2 → dial_agentframework-0.20.0}/README.md +0 -0
- {dial_agentframework-0.19.2 → dial_agentframework-0.20.0}/dial_agentframework/__init__.py +0 -0
- {dial_agentframework-0.19.2 → dial_agentframework-0.20.0}/examples/signup_agentframework.ipynb +0 -0
|
@@ -115,7 +115,8 @@ def set_number_properties_tool(client: DialClient) -> FunctionTool:
|
|
|
115
115
|
description=(
|
|
116
116
|
"Update a Dial phone number's properties: its inbound instruction (the system "
|
|
117
117
|
"prompt its AI voice agent uses on inbound calls), its nickname, and/or whether "
|
|
118
|
-
"calling is switched on at all (calling_enabled)
|
|
118
|
+
"calling is switched on at all (calling_enabled) or forwards inbound calls to "
|
|
119
|
+
"another phone (forward_to). "
|
|
119
120
|
"On iMessage numbers you can also set the display identity (first/last name "
|
|
120
121
|
"and avatar photo) shown to recipients. Provide at least one."
|
|
121
122
|
),
|
|
@@ -173,6 +174,12 @@ def set_number_properties_tool(client: DialClient) -> FunctionTool:
|
|
|
173
174
|
"the number is unaffected. Takes effect on the next call — a call already in "
|
|
174
175
|
"progress is not ended. Omit to leave it unchanged.",
|
|
175
176
|
] = None,
|
|
177
|
+
forward_to: Annotated[
|
|
178
|
+
Optional[str],
|
|
179
|
+
"Forward inbound calls to this phone number (E.164) instead of having the AI "
|
|
180
|
+
"voice agent answer; the call ends if that phone is busy or doesn't answer. "
|
|
181
|
+
"Pass an empty string to stop forwarding. Omitted leaves it unchanged.",
|
|
182
|
+
] = None,
|
|
176
183
|
) -> str:
|
|
177
184
|
kwargs: dict = {}
|
|
178
185
|
if inbound_instruction is not None:
|
|
@@ -199,17 +206,21 @@ def set_number_properties_tool(client: DialClient) -> FunctionTool:
|
|
|
199
206
|
# False is a real value here; only None means "leave unchanged".
|
|
200
207
|
if calling_enabled is not None:
|
|
201
208
|
kwargs["calling_enabled"] = calling_enabled
|
|
209
|
+
# Empty string stops forwarding (sent as null); None means "leave unchanged".
|
|
210
|
+
if forward_to is not None:
|
|
211
|
+
kwargs["forward_to"] = forward_to or None
|
|
202
212
|
if not kwargs:
|
|
203
213
|
return (
|
|
204
214
|
"Provide at least one of inbound_instruction, inbound_voice_gender, "
|
|
205
215
|
"inbound_language, nickname, max_call_duration_seconds, calling_enabled, "
|
|
206
|
-
"first_name, last_name, or avatar_url."
|
|
216
|
+
"forward_to, first_name, last_name, or avatar_url."
|
|
207
217
|
)
|
|
208
218
|
number = await client.set_number_properties(number_id, **kwargs)
|
|
209
219
|
nick = f' | nickname: "{number.nickname}"' if number.nickname else ""
|
|
210
220
|
# Reported only when off, so a messaging-only line isn't a silent surprise.
|
|
211
221
|
calling = "" if number.calling_enabled else " | calling: off (messaging only)"
|
|
212
|
-
|
|
222
|
+
fwd = f" | forwarding calls to {number.forward_to}" if number.forward_to else ""
|
|
223
|
+
return f"Updated {number.number} (id: {number.id}){nick}{calling}{fwd}"
|
|
213
224
|
|
|
214
225
|
return set_number_properties
|
|
215
226
|
|
|
@@ -35,6 +35,7 @@ class _FakeNumber:
|
|
|
35
35
|
country = "US"
|
|
36
36
|
nickname = None
|
|
37
37
|
calling_enabled = True
|
|
38
|
+
forward_to = None
|
|
38
39
|
|
|
39
40
|
|
|
40
41
|
class FakeClient:
|
|
@@ -297,6 +298,34 @@ def test_set_number_properties_omits_unprovided_name_fields():
|
|
|
297
298
|
assert kwargs["nickname"] == "Support"
|
|
298
299
|
|
|
299
300
|
|
|
301
|
+
def test_set_number_properties_forwards_forward_to():
|
|
302
|
+
client = FakeClient(set_number_properties=_FakeNumber())
|
|
303
|
+
tool = set_number_properties_tool(client)
|
|
304
|
+
_run(tool, number_id="pn_9", forward_to="+18005550100")
|
|
305
|
+
|
|
306
|
+
assert client.calls["set_number_properties"]["kwargs"]["forward_to"] == "+18005550100"
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
def test_set_number_properties_empty_forward_to_stops_forwarding():
|
|
310
|
+
# An empty string is sent to the SDK as None — an explicit null that stops
|
|
311
|
+
# forwarding — rather than being swallowed like an omitted argument.
|
|
312
|
+
client = FakeClient(set_number_properties=_FakeNumber())
|
|
313
|
+
tool = set_number_properties_tool(client)
|
|
314
|
+
_run(tool, number_id="pn_9", forward_to="")
|
|
315
|
+
|
|
316
|
+
kwargs = client.calls["set_number_properties"]["kwargs"]
|
|
317
|
+
assert "forward_to" in kwargs
|
|
318
|
+
assert kwargs["forward_to"] is None
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
def test_set_number_properties_omits_unprovided_forward_to():
|
|
322
|
+
client = FakeClient(set_number_properties=_FakeNumber())
|
|
323
|
+
tool = set_number_properties_tool(client)
|
|
324
|
+
_run(tool, number_id="pn_9", nickname="Support")
|
|
325
|
+
|
|
326
|
+
assert "forward_to" not in client.calls["set_number_properties"]["kwargs"]
|
|
327
|
+
|
|
328
|
+
|
|
300
329
|
def test_make_call_passes_idempotency_key():
|
|
301
330
|
client = FakeClient(make_call=_FakeCall())
|
|
302
331
|
tool = make_call_tool(client)
|
|
@@ -345,7 +345,7 @@ wheels = [
|
|
|
345
345
|
|
|
346
346
|
[[package]]
|
|
347
347
|
name = "dial-agentframework"
|
|
348
|
-
version = "0.
|
|
348
|
+
version = "0.20.0"
|
|
349
349
|
source = { editable = "." }
|
|
350
350
|
dependencies = [
|
|
351
351
|
{ name = "agent-framework-core" },
|
|
@@ -368,7 +368,7 @@ dev = [{ name = "pytest", specifier = ">=8" }]
|
|
|
368
368
|
|
|
369
369
|
[[package]]
|
|
370
370
|
name = "dial-sdk"
|
|
371
|
-
version = "0.
|
|
371
|
+
version = "0.32.0"
|
|
372
372
|
source = { editable = "../sdk-python" }
|
|
373
373
|
dependencies = [
|
|
374
374
|
{ name = "httpx" },
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dial_agentframework-0.19.2 → dial_agentframework-0.20.0}/examples/signup_agentframework.ipynb
RENAMED
|
File without changes
|