|
1 | 1 | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. |
2 | 2 |
|
3 | | -from typing import Dict, List, Union, Optional |
| 3 | +from typing import TYPE_CHECKING, Dict, List, Union, Optional |
4 | 4 | from typing_extensions import Literal, Annotated, TypeAlias |
5 | 5 |
|
6 | 6 | from pydantic import Field as FieldInfo |
|
36 | 36 | "ReferReferSipHeader", |
37 | 37 | "SendDtmf", |
38 | 38 | "SendMessage", |
| 39 | + "SendMessageSendMessage", |
39 | 40 | "SkipTurn", |
40 | 41 | "SkipTurnSkipTurn", |
41 | 42 | ] |
@@ -357,12 +358,35 @@ class SendDtmf(BaseModel): |
357 | 358 | type: Literal["send_dtmf"] |
358 | 359 |
|
359 | 360 |
|
| 361 | +class SendMessageSendMessage(BaseModel): |
| 362 | + message_template: Optional[str] = None |
| 363 | + """ |
| 364 | + Optional message template with dynamic variable support using mustache syntax |
| 365 | + (e.g., {{variable_name}}). When set, the assistant will use this template for |
| 366 | + the SMS body instead of generating one. Dynamic variables like |
| 367 | + {{telnyx_end_user_target}}, {{telnyx_agent_target}}, and custom webhook-provided |
| 368 | + variables will be resolved at runtime. |
| 369 | + """ |
| 370 | + |
| 371 | + if TYPE_CHECKING: |
| 372 | + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a |
| 373 | + # value to this field, so for compatibility we avoid doing it at runtime. |
| 374 | + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] |
| 375 | + |
| 376 | + # Stub to indicate that arbitrary properties are accepted. |
| 377 | + # To access properties that are not valid identifiers you can use `getattr`, e.g. |
| 378 | + # `getattr(obj, '$type')` |
| 379 | + def __getattr__(self, attr: str) -> object: ... |
| 380 | + else: |
| 381 | + __pydantic_extra__: Dict[str, object] |
| 382 | + |
| 383 | + |
360 | 384 | class SendMessage(BaseModel): |
361 | 385 | """ |
362 | | - The send_message tool allows the assistant to send SMS or MMS messages to the end user. The 'to' and 'from' addresses are automatically determined from the conversation context, and the message text is generated by the assistant. |
| 386 | + The send_message tool allows the assistant to send SMS or MMS messages to the end user. The 'to' and 'from' addresses are automatically determined from the conversation context, and the message text is generated by the assistant unless a message_template is provided for runtime variable substitution. |
363 | 387 | """ |
364 | 388 |
|
365 | | - send_message: Dict[str, object] |
| 389 | + send_message: SendMessageSendMessage |
366 | 390 |
|
367 | 391 | type: Literal["send_message"] |
368 | 392 |
|
|
0 commit comments