Skip to content

Commit a521822

Browse files
release: 4.96.0 (#250)
* feat: AI-2180: Add message_template to SendMessageTool schema * release: 4.96.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 2d4a24d commit a521822

7 files changed

Lines changed: 54 additions & 10 deletions

File tree

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "4.95.0"
2+
".": "4.96.0"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1022
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/telnyx%2Ftelnyx-bd7b53aa31b84a32ceb374b371804a27876a0ef77cf48e61f7a0b68eddc5922b.yml
3-
openapi_spec_hash: 82263212fe68d2f3f80e6bd6a0c0bcac
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/telnyx%2Ftelnyx-89a9050aa64756582ce8923c6abfaa5eae030e794b53d10bab86b15fa30b02bf.yml
3+
openapi_spec_hash: da75df9cb0618f9a3d6eb8a2f77b0752
44
config_hash: 6d9dae7db10d5a23624637b34428fcfd

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 4.96.0 (2026-04-07)
4+
5+
Full Changelog: [v4.95.0...v4.96.0](https://github.com/team-telnyx/telnyx-python/compare/v4.95.0...v4.96.0)
6+
7+
### Features
8+
9+
* AI-2180: Add message_template to SendMessageTool schema ([7e21d03](https://github.com/team-telnyx/telnyx-python/commit/7e21d03c66deab58fdad063a0f9b2b14805576d2))
10+
311
## 4.95.0 (2026-04-07)
412

513
Full Changelog: [v4.94.1...v4.95.0](https://github.com/team-telnyx/telnyx-python/compare/v4.94.1...v4.95.0)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "telnyx"
3-
version = "4.95.0"
3+
version = "4.96.0"
44
description = "The official Python library for the telnyx API"
55
dynamic = ["readme"]
66
license = "MIT"

src/telnyx/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
__title__ = "telnyx"
4-
__version__ = "4.95.0" # x-release-please-version
4+
__version__ = "4.96.0" # x-release-please-version

src/telnyx/types/ai/assistant_tool.py

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import Dict, List, Union, Optional
3+
from typing import TYPE_CHECKING, Dict, List, Union, Optional
44
from typing_extensions import Literal, Annotated, TypeAlias
55

66
from pydantic import Field as FieldInfo
@@ -36,6 +36,7 @@
3636
"ReferReferSipHeader",
3737
"SendDtmf",
3838
"SendMessage",
39+
"SendMessageSendMessage",
3940
"SkipTurn",
4041
"SkipTurnSkipTurn",
4142
]
@@ -357,12 +358,35 @@ class SendDtmf(BaseModel):
357358
type: Literal["send_dtmf"]
358359

359360

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+
360384
class SendMessage(BaseModel):
361385
"""
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.
363387
"""
364388

365-
send_message: Dict[str, object]
389+
send_message: SendMessageSendMessage
366390

367391
type: Literal["send_message"]
368392

src/telnyx/types/ai/assistant_tool_param.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"ReferReferSipHeader",
3535
"SendDtmf",
3636
"SendMessage",
37+
"SendMessageSendMessage",
3738
"SkipTurn",
3839
"SkipTurnSkipTurn",
3940
]
@@ -367,12 +368,23 @@ class SendDtmf(TypedDict, total=False):
367368
type: Required[Literal["send_dtmf"]]
368369

369370

371+
class SendMessageSendMessage(TypedDict, total=False, extra_items=object): # type: ignore[call-arg]
372+
message_template: Optional[str]
373+
"""
374+
Optional message template with dynamic variable support using mustache syntax
375+
(e.g., {{variable_name}}). When set, the assistant will use this template for
376+
the SMS body instead of generating one. Dynamic variables like
377+
{{telnyx_end_user_target}}, {{telnyx_agent_target}}, and custom webhook-provided
378+
variables will be resolved at runtime.
379+
"""
380+
381+
370382
class SendMessage(TypedDict, total=False):
371383
"""
372-
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.
384+
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.
373385
"""
374386

375-
send_message: Required[Dict[str, object]]
387+
send_message: Required[SendMessageSendMessage]
376388

377389
type: Required[Literal["send_message"]]
378390

0 commit comments

Comments
 (0)