Skip to content

Commit 18b768b

Browse files
feat: Assistant tool targets master
1 parent 275a6c8 commit 18b768b

4 files changed

Lines changed: 68 additions & 21 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1029
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/telnyx/telnyx-9cfd47bb2747ed2693b2868d5c8e5251304945942177d39a267e77c6d80e136f.yml
3-
openapi_spec_hash: 674c8923bd7154e371c7767bdc61f452
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/telnyx/telnyx-35d340e5ffbb2d89bd09071a71f9e2eca828fd32fe54e1726327482ed11d0ed0.yml
3+
openapi_spec_hash: 173b343b2ad2b4a3d8e5513c5cae1e69
44
config_hash: 77bd21b3699ffa20c210990f62eb8879

src/telnyx/types/ai/assistant_tool.py

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"HandoffHandoffAIAssistant",
1919
"Transfer",
2020
"TransferTransfer",
21-
"TransferTransferTarget",
21+
"TransferTransferTargetsUnionMember0",
2222
"TransferTransferCustomHeader",
2323
"TransferTransferVoicemailDetection",
2424
"TransferTransferVoicemailDetectionDetectionConfig",
@@ -27,6 +27,7 @@
2727
"Invite",
2828
"InviteInviteConfig",
2929
"InviteInviteConfigCustomHeader",
30+
"InviteInviteConfigTargetsUnionMember0",
3031
"InviteInviteConfigVoicemailDetection",
3132
"InviteInviteConfigVoicemailDetectionOnVoicemailDetected",
3233
"Refer",
@@ -73,13 +74,13 @@ class Handoff(BaseModel):
7374
type: Literal["handoff"]
7475

7576

76-
class TransferTransferTarget(BaseModel):
77+
class TransferTransferTargetsUnionMember0(BaseModel):
78+
to: str
79+
"""The destination number or SIP URI of the call."""
80+
7781
name: Optional[str] = None
7882
"""The name of the target."""
7983

80-
to: Optional[str] = None
81-
"""The destination number or SIP URI of the call."""
82-
8384

8485
class TransferTransferCustomHeader(BaseModel):
8586
name: Optional[str] = None
@@ -199,10 +200,13 @@ class TransferTransfer(BaseModel):
199200
from_: str = FieldInfo(alias="from")
200201
"""Number or SIP URI placing the call."""
201202

202-
targets: List[TransferTransferTarget]
203+
targets: Union[List[TransferTransferTargetsUnionMember0], str]
203204
"""The different possible targets of the transfer.
204205
205206
The assistant will be able to choose one of the targets to transfer the call to.
207+
This can also be a dynamic variable string like `{{ targets }}` where `targets`
208+
is returned by the dynamic variables webhook and resolves to an array of target
209+
objects at runtime.
206210
"""
207211

208212
custom_headers: Optional[List[TransferTransferCustomHeader]] = None
@@ -248,6 +252,14 @@ class InviteInviteConfigCustomHeader(BaseModel):
248252
"""
249253

250254

255+
class InviteInviteConfigTargetsUnionMember0(BaseModel):
256+
to: str
257+
"""The destination number or SIP URI of the call."""
258+
259+
name: Optional[str] = None
260+
"""The name of the target."""
261+
262+
251263
class InviteInviteConfigVoicemailDetectionOnVoicemailDetected(BaseModel):
252264
"""Action to take when voicemail is detected on the invited call."""
253265

@@ -278,6 +290,16 @@ class InviteInviteConfig(BaseModel):
278290
from_: Optional[str] = FieldInfo(alias="from", default=None)
279291
"""Number or SIP URI placing the call."""
280292

293+
targets: Union[List[InviteInviteConfigTargetsUnionMember0], str, None] = None
294+
"""The different possible targets of the invite.
295+
296+
The assistant will be able to choose one of the targets to invite to the call.
297+
This can also be a dynamic variable string like `{{ targets }}` where `targets`
298+
is returned by the dynamic variables webhook and resolves to an array of target
299+
objects at runtime. If omitted or null, the invite tool can still be configured
300+
and targets may be supplied dynamically at runtime.
301+
"""
302+
281303
voicemail_detection: Optional[InviteInviteConfigVoicemailDetection] = None
282304
"""
283305
Configuration for voicemail detection (AMD - Answering Machine Detection) on the

src/telnyx/types/ai/assistant_tool_param.py

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"HandoffHandoffAIAssistant",
1717
"Transfer",
1818
"TransferTransfer",
19-
"TransferTransferTarget",
19+
"TransferTransferTargetsUnionMember0",
2020
"TransferTransferCustomHeader",
2121
"TransferTransferVoicemailDetection",
2222
"TransferTransferVoicemailDetectionDetectionConfig",
@@ -25,6 +25,7 @@
2525
"Invite",
2626
"InviteInviteConfig",
2727
"InviteInviteConfigCustomHeader",
28+
"InviteInviteConfigTargetsUnionMember0",
2829
"InviteInviteConfigVoicemailDetection",
2930
"InviteInviteConfigVoicemailDetectionOnVoicemailDetected",
3031
"Refer",
@@ -71,13 +72,13 @@ class Handoff(TypedDict, total=False):
7172
type: Required[Literal["handoff"]]
7273

7374

74-
class TransferTransferTarget(TypedDict, total=False):
75+
class TransferTransferTargetsUnionMember0(TypedDict, total=False):
76+
to: Required[str]
77+
"""The destination number or SIP URI of the call."""
78+
7579
name: str
7680
"""The name of the target."""
7781

78-
to: str
79-
"""The destination number or SIP URI of the call."""
80-
8182

8283
class TransferTransferCustomHeader(TypedDict, total=False):
8384
name: str
@@ -203,10 +204,13 @@ class TransferTransferVoicemailDetection(TypedDict, total=False):
203204

204205

205206
class TransferTransfer(_TransferTransferReservedKeywords, total=False):
206-
targets: Required[Iterable[TransferTransferTarget]]
207+
targets: Required[Union[Iterable[TransferTransferTargetsUnionMember0], str]]
207208
"""The different possible targets of the transfer.
208209
209210
The assistant will be able to choose one of the targets to transfer the call to.
211+
This can also be a dynamic variable string like `{{ targets }}` where `targets`
212+
is returned by the dynamic variables webhook and resolves to an array of target
213+
objects at runtime.
210214
"""
211215

212216
custom_headers: Iterable[TransferTransferCustomHeader]
@@ -252,6 +256,14 @@ class InviteInviteConfigCustomHeader(TypedDict, total=False):
252256
"""
253257

254258

259+
class InviteInviteConfigTargetsUnionMember0(TypedDict, total=False):
260+
to: Required[str]
261+
"""The destination number or SIP URI of the call."""
262+
263+
name: str
264+
"""The name of the target."""
265+
266+
255267
class InviteInviteConfigVoicemailDetectionOnVoicemailDetected(TypedDict, total=False):
256268
"""Action to take when voicemail is detected on the invited call."""
257269

@@ -288,6 +300,16 @@ class InviteInviteConfig(_InviteInviteConfigReservedKeywords, total=False):
288300
custom_headers: Iterable[InviteInviteConfigCustomHeader]
289301
"""Custom headers to be added to the SIP INVITE for the invite command."""
290302

303+
targets: Union[Iterable[InviteInviteConfigTargetsUnionMember0], str, None]
304+
"""The different possible targets of the invite.
305+
306+
The assistant will be able to choose one of the targets to invite to the call.
307+
This can also be a dynamic variable string like `{{ targets }}` where `targets`
308+
is returned by the dynamic variables webhook and resolves to an array of target
309+
objects at runtime. If omitted or null, the invite tool can still be configured
310+
and targets may be supplied dynamically at runtime.
311+
"""
312+
291313
voicemail_detection: InviteInviteConfigVoicemailDetection
292314
"""
293315
Configuration for voicemail detection (AMD - Answering Machine Detection) on the

src/telnyx/types/ai/transfer_tool_param.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22

33
from __future__ import annotations
44

5-
from typing import Iterable
5+
from typing import Union, Iterable
66
from typing_extensions import Literal, Required, TypedDict
77

8-
__all__ = ["TransferToolParam", "Transfer", "TransferTarget"]
8+
__all__ = ["TransferToolParam", "Transfer", "TransferTargetsUnionMember0"]
99

1010

11-
class TransferTarget(TypedDict, total=False):
11+
class TransferTargetsUnionMember0(TypedDict, total=False):
12+
to: Required[str]
13+
"""The destination number or SIP URI of the call."""
14+
1215
name: str
1316
"""The name of the target."""
1417

15-
to: str
16-
"""The destination number or SIP URI of the call."""
17-
1818

1919
_TransferReservedKeywords = TypedDict(
2020
"_TransferReservedKeywords",
@@ -26,10 +26,13 @@ class TransferTarget(TypedDict, total=False):
2626

2727

2828
class Transfer(_TransferReservedKeywords, total=False):
29-
targets: Required[Iterable[TransferTarget]]
29+
targets: Required[Union[Iterable[TransferTargetsUnionMember0], str]]
3030
"""The different possible targets of the transfer.
3131
3232
The assistant will be able to choose one of the targets to transfer the call to.
33+
This can also be a dynamic variable string like `{{ targets }}` where `targets`
34+
is returned by the dynamic variables webhook and resolves to an array of target
35+
objects at runtime.
3336
"""
3437

3538

0 commit comments

Comments
 (0)