telnyx 3.5.0a0__py3-none-any.whl → 3.7.0a0__py3-none-any.whl
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.
Potentially problematic release.
This version of telnyx might be problematic. Click here for more details.
- telnyx/_client.py +53 -2
- telnyx/_version.py +1 -1
- telnyx/resources/__init__.py +70 -0
- telnyx/resources/ai/conversations/conversations.py +137 -3
- telnyx/resources/ai/conversations/messages.py +1 -134
- telnyx/resources/calls/actions.py +146 -146
- telnyx/resources/calls/calls.py +4 -10
- telnyx/resources/conferences/actions.py +8 -24
- telnyx/resources/conferences/conferences.py +2 -6
- telnyx/resources/legacy/__init__.py +33 -0
- telnyx/resources/legacy/legacy.py +102 -0
- telnyx/resources/legacy/reporting/__init__.py +47 -0
- telnyx/resources/legacy/reporting/batch_detail_records/__init__.py +61 -0
- telnyx/resources/legacy/reporting/batch_detail_records/batch_detail_records.py +166 -0
- telnyx/resources/legacy/reporting/batch_detail_records/messaging.py +481 -0
- telnyx/resources/legacy/reporting/batch_detail_records/speech_to_text.py +399 -0
- telnyx/resources/legacy/reporting/batch_detail_records/voice.py +538 -0
- telnyx/resources/legacy/reporting/reporting.py +134 -0
- telnyx/resources/legacy/reporting/usage_reports/__init__.py +61 -0
- telnyx/resources/legacy/reporting/usage_reports/messaging.py +471 -0
- telnyx/resources/legacy/reporting/usage_reports/number_lookup.py +464 -0
- telnyx/resources/legacy/reporting/usage_reports/usage_reports.py +288 -0
- telnyx/resources/legacy/reporting/usage_reports/voice.py +493 -0
- telnyx/resources/oauth.py +855 -0
- telnyx/resources/oauth_clients.py +711 -0
- telnyx/resources/oauth_grants.py +349 -0
- telnyx/resources/phone_numbers/jobs.py +12 -0
- telnyx/resources/porting_orders/porting_orders.py +20 -8
- telnyx/resources/sim_cards/sim_cards.py +3 -2
- telnyx/resources/verifications/verifications.py +10 -0
- telnyx/resources/verify_profiles.py +183 -1
- telnyx/resources/well_known.py +198 -0
- telnyx/types/__init__.py +41 -1
- telnyx/types/addresses/action_validate_response.py +2 -2
- telnyx/types/ai/__init__.py +1 -0
- telnyx/types/ai/{conversations/message_create_params.py → conversation_add_message_params.py} +4 -4
- telnyx/types/ai/conversations/__init__.py +0 -1
- telnyx/types/ai/inference_embedding_webhook_tool_params.py +2 -0
- telnyx/types/ai/inference_embedding_webhook_tool_params_param.py +2 -0
- telnyx/types/{error.py → api_error.py} +2 -2
- telnyx/types/call_dial_params.py +2 -3
- telnyx/types/calls/action_answer_params.py +1 -2
- telnyx/types/calls/action_gather_using_ai_params.py +5 -8
- telnyx/types/calls/action_start_streaming_params.py +4 -2
- telnyx/types/calls/action_transfer_params.py +50 -0
- telnyx/types/campaign_submit_appeal_response.py +0 -3
- telnyx/types/legacy/__init__.py +3 -0
- telnyx/types/legacy/reporting/__init__.py +10 -0
- telnyx/types/legacy/reporting/batch_detail_records/__init__.py +20 -0
- telnyx/types/legacy/reporting/batch_detail_records/messaging_create_params.py +77 -0
- telnyx/types/legacy/reporting/batch_detail_records/messaging_create_response.py +68 -0
- telnyx/types/legacy/reporting/batch_detail_records/messaging_delete_response.py +68 -0
- telnyx/types/legacy/reporting/batch_detail_records/messaging_list_response.py +80 -0
- telnyx/types/legacy/reporting/batch_detail_records/messaging_retrieve_response.py +68 -0
- telnyx/types/legacy/reporting/batch_detail_records/speech_to_text_create_params.py +19 -0
- telnyx/types/legacy/reporting/batch_detail_records/speech_to_text_create_response.py +31 -0
- telnyx/types/legacy/reporting/batch_detail_records/speech_to_text_delete_response.py +31 -0
- telnyx/types/legacy/reporting/batch_detail_records/speech_to_text_list_response.py +31 -0
- telnyx/types/legacy/reporting/batch_detail_records/speech_to_text_retrieve_response.py +31 -0
- telnyx/types/legacy/reporting/batch_detail_records/voice_create_params.py +79 -0
- telnyx/types/legacy/reporting/batch_detail_records/voice_create_response.py +91 -0
- telnyx/types/legacy/reporting/batch_detail_records/voice_delete_response.py +91 -0
- telnyx/types/legacy/reporting/batch_detail_records/voice_list_response.py +102 -0
- telnyx/types/legacy/reporting/batch_detail_records/voice_retrieve_fields_response.py +23 -0
- telnyx/types/legacy/reporting/batch_detail_records/voice_retrieve_response.py +91 -0
- telnyx/types/legacy/reporting/usage_report_retrieve_speech_to_text_params.py +17 -0
- telnyx/types/legacy/reporting/usage_report_retrieve_speech_to_text_response.py +11 -0
- telnyx/types/legacy/reporting/usage_reports/__init__.py +18 -0
- telnyx/types/legacy/reporting/usage_reports/messaging_create_params.py +29 -0
- telnyx/types/legacy/reporting/usage_reports/messaging_create_response.py +43 -0
- telnyx/types/legacy/reporting/usage_reports/messaging_delete_response.py +43 -0
- telnyx/types/legacy/reporting/usage_reports/messaging_list_params.py +15 -0
- telnyx/types/legacy/reporting/usage_reports/messaging_list_response.py +54 -0
- telnyx/types/legacy/reporting/usage_reports/messaging_retrieve_response.py +43 -0
- telnyx/types/legacy/reporting/usage_reports/number_lookup_create_params.py +26 -0
- telnyx/types/legacy/reporting/usage_reports/number_lookup_list_params.py +13 -0
- telnyx/types/legacy/reporting/usage_reports/voice_create_params.py +40 -0
- telnyx/types/legacy/reporting/usage_reports/voice_create_response.py +48 -0
- telnyx/types/legacy/reporting/usage_reports/voice_delete_response.py +48 -0
- telnyx/types/legacy/reporting/usage_reports/voice_list_params.py +15 -0
- telnyx/types/legacy/reporting/usage_reports/voice_list_response.py +59 -0
- telnyx/types/legacy/reporting/usage_reports/voice_retrieve_response.py +48 -0
- telnyx/types/number_order_status_update_webhook_event.py +30 -4
- telnyx/types/oauth_client_create_params.py +39 -0
- telnyx/types/oauth_client_create_response.py +63 -0
- telnyx/types/oauth_client_list_params.py +38 -0
- telnyx/types/oauth_client_list_response.py +79 -0
- telnyx/types/oauth_client_retrieve_response.py +63 -0
- telnyx/types/oauth_client_update_params.py +36 -0
- telnyx/types/oauth_client_update_response.py +63 -0
- telnyx/types/oauth_grant_delete_response.py +33 -0
- telnyx/types/oauth_grant_list_params.py +17 -0
- telnyx/types/oauth_grant_list_response.py +49 -0
- telnyx/types/oauth_grant_retrieve_response.py +33 -0
- telnyx/types/oauth_grants_params.py +15 -0
- telnyx/types/oauth_grants_response.py +10 -0
- telnyx/types/oauth_introspect_params.py +12 -0
- telnyx/types/oauth_introspect_response.py +30 -0
- telnyx/types/oauth_register_params.py +39 -0
- telnyx/types/oauth_register_response.py +45 -0
- telnyx/types/oauth_retrieve_authorize_params.py +30 -0
- telnyx/types/oauth_retrieve_jwks_response.py +25 -0
- telnyx/types/oauth_retrieve_response.py +47 -0
- telnyx/types/oauth_token_params.py +33 -0
- telnyx/types/oauth_token_response.py +25 -0
- telnyx/types/phone_number_delete_response.py +7 -0
- telnyx/types/phone_number_detailed.py +7 -0
- telnyx/types/phone_number_list_params.py +6 -0
- telnyx/types/phone_numbers/job_update_batch_params.py +7 -0
- telnyx/types/porting_order.py +3 -0
- telnyx/types/porting_order_create_params.py +3 -0
- telnyx/types/porting_order_list_params.py +52 -31
- telnyx/types/porting_order_update_params.py +2 -0
- telnyx/types/porting_orders/phone_number_configuration_list_params.py +19 -19
- telnyx/types/shared/simple_sim_card.py +15 -0
- telnyx/types/sim_card.py +12 -0
- telnyx/types/sim_card_update_params.py +2 -1
- telnyx/types/stream_bidirectional_codec.py +1 -1
- telnyx/types/stream_codec.py +1 -1
- telnyx/types/verification_trigger_call_params.py +7 -0
- telnyx/types/verify_profile_create_template_params.py +12 -0
- telnyx/types/verify_profile_create_template_response.py +17 -0
- telnyx/types/verify_profile_update_template_params.py +12 -0
- telnyx/types/verify_profile_update_template_response.py +17 -0
- telnyx/types/well_known_retrieve_authorization_server_metadata_response.py +42 -0
- telnyx/types/well_known_retrieve_protected_resource_metadata_response.py +15 -0
- {telnyx-3.5.0a0.dist-info → telnyx-3.7.0a0.dist-info}/METADATA +1 -1
- {telnyx-3.5.0a0.dist-info → telnyx-3.7.0a0.dist-info}/RECORD +130 -48
- {telnyx-3.5.0a0.dist-info → telnyx-3.7.0a0.dist-info}/WHEEL +0 -0
- {telnyx-3.5.0a0.dist-info → telnyx-3.7.0a0.dist-info}/licenses/LICENSE +0 -0
|
@@ -2,13 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Dict, Union, Iterable
|
|
6
|
-
from datetime import datetime
|
|
7
|
-
|
|
8
5
|
import httpx
|
|
9
6
|
|
|
10
|
-
from ...._types import Body,
|
|
11
|
-
from ...._utils import maybe_transform, async_maybe_transform
|
|
7
|
+
from ...._types import Body, Query, Headers, NotGiven, not_given
|
|
12
8
|
from ...._compat import cached_property
|
|
13
9
|
from ...._resource import SyncAPIResource, AsyncAPIResource
|
|
14
10
|
from ...._response import (
|
|
@@ -18,7 +14,6 @@ from ...._response import (
|
|
|
18
14
|
async_to_streamed_response_wrapper,
|
|
19
15
|
)
|
|
20
16
|
from ...._base_client import make_request_options
|
|
21
|
-
from ....types.ai.conversations import message_create_params
|
|
22
17
|
from ....types.ai.conversations.message_list_response import MessageListResponse
|
|
23
18
|
|
|
24
19
|
__all__ = ["MessagesResource", "AsyncMessagesResource"]
|
|
@@ -44,64 +39,6 @@ class MessagesResource(SyncAPIResource):
|
|
|
44
39
|
"""
|
|
45
40
|
return MessagesResourceWithStreamingResponse(self)
|
|
46
41
|
|
|
47
|
-
def create(
|
|
48
|
-
self,
|
|
49
|
-
conversation_id: str,
|
|
50
|
-
*,
|
|
51
|
-
role: str,
|
|
52
|
-
content: str | Omit = omit,
|
|
53
|
-
metadata: Dict[str, Union[str, int, bool, SequenceNotStr[Union[str, int, bool]]]] | Omit = omit,
|
|
54
|
-
name: str | Omit = omit,
|
|
55
|
-
sent_at: Union[str, datetime] | Omit = omit,
|
|
56
|
-
tool_call_id: str | Omit = omit,
|
|
57
|
-
tool_calls: Iterable[Dict[str, object]] | Omit = omit,
|
|
58
|
-
tool_choice: Union[str, object] | Omit = omit,
|
|
59
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
60
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
61
|
-
extra_headers: Headers | None = None,
|
|
62
|
-
extra_query: Query | None = None,
|
|
63
|
-
extra_body: Body | None = None,
|
|
64
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
65
|
-
) -> object:
|
|
66
|
-
"""Add a new message to the conversation.
|
|
67
|
-
|
|
68
|
-
Used to insert a new messages to a
|
|
69
|
-
conversation manually ( without using chat endpoint )
|
|
70
|
-
|
|
71
|
-
Args:
|
|
72
|
-
conversation_id: The ID of the conversation
|
|
73
|
-
|
|
74
|
-
extra_headers: Send extra headers
|
|
75
|
-
|
|
76
|
-
extra_query: Add additional query parameters to the request
|
|
77
|
-
|
|
78
|
-
extra_body: Add additional JSON properties to the request
|
|
79
|
-
|
|
80
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
81
|
-
"""
|
|
82
|
-
if not conversation_id:
|
|
83
|
-
raise ValueError(f"Expected a non-empty value for `conversation_id` but received {conversation_id!r}")
|
|
84
|
-
return self._post(
|
|
85
|
-
f"/ai/conversations/{conversation_id}/messages",
|
|
86
|
-
body=maybe_transform(
|
|
87
|
-
{
|
|
88
|
-
"role": role,
|
|
89
|
-
"content": content,
|
|
90
|
-
"metadata": metadata,
|
|
91
|
-
"name": name,
|
|
92
|
-
"sent_at": sent_at,
|
|
93
|
-
"tool_call_id": tool_call_id,
|
|
94
|
-
"tool_calls": tool_calls,
|
|
95
|
-
"tool_choice": tool_choice,
|
|
96
|
-
},
|
|
97
|
-
message_create_params.MessageCreateParams,
|
|
98
|
-
),
|
|
99
|
-
options=make_request_options(
|
|
100
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
101
|
-
),
|
|
102
|
-
cast_to=object,
|
|
103
|
-
)
|
|
104
|
-
|
|
105
42
|
def list(
|
|
106
43
|
self,
|
|
107
44
|
conversation_id: str,
|
|
@@ -157,64 +94,6 @@ class AsyncMessagesResource(AsyncAPIResource):
|
|
|
157
94
|
"""
|
|
158
95
|
return AsyncMessagesResourceWithStreamingResponse(self)
|
|
159
96
|
|
|
160
|
-
async def create(
|
|
161
|
-
self,
|
|
162
|
-
conversation_id: str,
|
|
163
|
-
*,
|
|
164
|
-
role: str,
|
|
165
|
-
content: str | Omit = omit,
|
|
166
|
-
metadata: Dict[str, Union[str, int, bool, SequenceNotStr[Union[str, int, bool]]]] | Omit = omit,
|
|
167
|
-
name: str | Omit = omit,
|
|
168
|
-
sent_at: Union[str, datetime] | Omit = omit,
|
|
169
|
-
tool_call_id: str | Omit = omit,
|
|
170
|
-
tool_calls: Iterable[Dict[str, object]] | Omit = omit,
|
|
171
|
-
tool_choice: Union[str, object] | Omit = omit,
|
|
172
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
173
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
174
|
-
extra_headers: Headers | None = None,
|
|
175
|
-
extra_query: Query | None = None,
|
|
176
|
-
extra_body: Body | None = None,
|
|
177
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
178
|
-
) -> object:
|
|
179
|
-
"""Add a new message to the conversation.
|
|
180
|
-
|
|
181
|
-
Used to insert a new messages to a
|
|
182
|
-
conversation manually ( without using chat endpoint )
|
|
183
|
-
|
|
184
|
-
Args:
|
|
185
|
-
conversation_id: The ID of the conversation
|
|
186
|
-
|
|
187
|
-
extra_headers: Send extra headers
|
|
188
|
-
|
|
189
|
-
extra_query: Add additional query parameters to the request
|
|
190
|
-
|
|
191
|
-
extra_body: Add additional JSON properties to the request
|
|
192
|
-
|
|
193
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
194
|
-
"""
|
|
195
|
-
if not conversation_id:
|
|
196
|
-
raise ValueError(f"Expected a non-empty value for `conversation_id` but received {conversation_id!r}")
|
|
197
|
-
return await self._post(
|
|
198
|
-
f"/ai/conversations/{conversation_id}/messages",
|
|
199
|
-
body=await async_maybe_transform(
|
|
200
|
-
{
|
|
201
|
-
"role": role,
|
|
202
|
-
"content": content,
|
|
203
|
-
"metadata": metadata,
|
|
204
|
-
"name": name,
|
|
205
|
-
"sent_at": sent_at,
|
|
206
|
-
"tool_call_id": tool_call_id,
|
|
207
|
-
"tool_calls": tool_calls,
|
|
208
|
-
"tool_choice": tool_choice,
|
|
209
|
-
},
|
|
210
|
-
message_create_params.MessageCreateParams,
|
|
211
|
-
),
|
|
212
|
-
options=make_request_options(
|
|
213
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
214
|
-
),
|
|
215
|
-
cast_to=object,
|
|
216
|
-
)
|
|
217
|
-
|
|
218
97
|
async def list(
|
|
219
98
|
self,
|
|
220
99
|
conversation_id: str,
|
|
@@ -254,9 +133,6 @@ class MessagesResourceWithRawResponse:
|
|
|
254
133
|
def __init__(self, messages: MessagesResource) -> None:
|
|
255
134
|
self._messages = messages
|
|
256
135
|
|
|
257
|
-
self.create = to_raw_response_wrapper(
|
|
258
|
-
messages.create,
|
|
259
|
-
)
|
|
260
136
|
self.list = to_raw_response_wrapper(
|
|
261
137
|
messages.list,
|
|
262
138
|
)
|
|
@@ -266,9 +142,6 @@ class AsyncMessagesResourceWithRawResponse:
|
|
|
266
142
|
def __init__(self, messages: AsyncMessagesResource) -> None:
|
|
267
143
|
self._messages = messages
|
|
268
144
|
|
|
269
|
-
self.create = async_to_raw_response_wrapper(
|
|
270
|
-
messages.create,
|
|
271
|
-
)
|
|
272
145
|
self.list = async_to_raw_response_wrapper(
|
|
273
146
|
messages.list,
|
|
274
147
|
)
|
|
@@ -278,9 +151,6 @@ class MessagesResourceWithStreamingResponse:
|
|
|
278
151
|
def __init__(self, messages: MessagesResource) -> None:
|
|
279
152
|
self._messages = messages
|
|
280
153
|
|
|
281
|
-
self.create = to_streamed_response_wrapper(
|
|
282
|
-
messages.create,
|
|
283
|
-
)
|
|
284
154
|
self.list = to_streamed_response_wrapper(
|
|
285
155
|
messages.list,
|
|
286
156
|
)
|
|
@@ -290,9 +160,6 @@ class AsyncMessagesResourceWithStreamingResponse:
|
|
|
290
160
|
def __init__(self, messages: AsyncMessagesResource) -> None:
|
|
291
161
|
self._messages = messages
|
|
292
162
|
|
|
293
|
-
self.create = async_to_streamed_response_wrapper(
|
|
294
|
-
messages.create,
|
|
295
|
-
)
|
|
296
163
|
self.list = async_to_streamed_response_wrapper(
|
|
297
164
|
messages.list,
|
|
298
165
|
)
|