syllable-sdk 0.37.5__py3-none-any.whl → 0.38.4__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.
- syllable_sdk/_version.py +3 -3
- syllable_sdk/agents.py +12 -12
- syllable_sdk/batches.py +18 -18
- syllable_sdk/campaigns.py +10 -10
- syllable_sdk/channels.py +8 -8
- syllable_sdk/conversations.py +2 -2
- syllable_sdk/custom_messages.py +10 -10
- syllable_sdk/dashboards.py +12 -12
- syllable_sdk/data_sources.py +10 -10
- syllable_sdk/events.py +2 -2
- syllable_sdk/folders.py +16 -16
- syllable_sdk/full_summary.py +2 -2
- syllable_sdk/incidents.py +12 -12
- syllable_sdk/insights_sdk.py +2 -2
- syllable_sdk/insights_tools.py +14 -14
- syllable_sdk/language_groups.py +12 -12
- syllable_sdk/latency.py +2 -2
- syllable_sdk/models/__init__.py +22 -0
- syllable_sdk/models/body_pronunciations_upload_csv.py +46 -0
- syllable_sdk/models/pronunciationscsvuploadresponse.py +68 -0
- syllable_sdk/models/toolproperties.py +1 -1
- syllable_sdk/numbers.py +6 -6
- syllable_sdk/organizations.py +8 -8
- syllable_sdk/permissions.py +2 -2
- syllable_sdk/prompts.py +14 -14
- syllable_sdk/pronunciations.py +201 -0
- syllable_sdk/roles.py +10 -10
- syllable_sdk/sdk.py +3 -0
- syllable_sdk/services.py +10 -10
- syllable_sdk/session_debug.py +6 -6
- syllable_sdk/session_labels.py +6 -6
- syllable_sdk/sessions.py +8 -8
- syllable_sdk/takeouts.py +6 -6
- syllable_sdk/targets.py +10 -10
- syllable_sdk/test.py +2 -2
- syllable_sdk/tools.py +10 -10
- syllable_sdk/transcript.py +2 -2
- syllable_sdk/twilio.py +6 -6
- syllable_sdk/users.py +14 -14
- syllable_sdk/v1.py +14 -14
- syllable_sdk/workflows.py +16 -16
- {syllable_sdk-0.37.5.dist-info → syllable_sdk-0.38.4.dist-info}/METADATA +5 -5
- {syllable_sdk-0.37.5.dist-info → syllable_sdk-0.38.4.dist-info}/RECORD +44 -41
- {syllable_sdk-0.37.5.dist-info → syllable_sdk-0.38.4.dist-info}/WHEEL +0 -0
syllable_sdk/models/__init__.py
CHANGED
|
@@ -68,6 +68,12 @@ if TYPE_CHECKING:
|
|
|
68
68
|
BodyOutboundBatchUploadFileTypedDict,
|
|
69
69
|
BodyOutboundBatchUploadTypedDict,
|
|
70
70
|
)
|
|
71
|
+
from .body_pronunciations_upload_csv import (
|
|
72
|
+
BodyPronunciationsUploadCsv,
|
|
73
|
+
BodyPronunciationsUploadCsvFile,
|
|
74
|
+
BodyPronunciationsUploadCsvFileTypedDict,
|
|
75
|
+
BodyPronunciationsUploadCsvTypedDict,
|
|
76
|
+
)
|
|
71
77
|
from .campaignproperties import CampaignProperties
|
|
72
78
|
from .channel import Channel, ChannelTypedDict
|
|
73
79
|
from .channel_targets_createop import (
|
|
@@ -622,6 +628,10 @@ if TYPE_CHECKING:
|
|
|
622
628
|
from .prompts_historyop import PromptsHistoryRequest, PromptsHistoryRequestTypedDict
|
|
623
629
|
from .prompts_listop import PromptsListRequest, PromptsListRequestTypedDict
|
|
624
630
|
from .promptupdaterequest import PromptUpdateRequest, PromptUpdateRequestTypedDict
|
|
631
|
+
from .pronunciationscsvuploadresponse import (
|
|
632
|
+
PronunciationsCsvUploadResponse,
|
|
633
|
+
PronunciationsCsvUploadResponseTypedDict,
|
|
634
|
+
)
|
|
625
635
|
from .requeststatus import RequestStatus
|
|
626
636
|
from .rolecreaterequest import RoleCreateRequest, RoleCreateRequestTypedDict
|
|
627
637
|
from .roleproperties import RoleProperties
|
|
@@ -887,6 +897,10 @@ __all__ = [
|
|
|
887
897
|
"BodyOutboundBatchUploadFile",
|
|
888
898
|
"BodyOutboundBatchUploadFileTypedDict",
|
|
889
899
|
"BodyOutboundBatchUploadTypedDict",
|
|
900
|
+
"BodyPronunciationsUploadCsv",
|
|
901
|
+
"BodyPronunciationsUploadCsvFile",
|
|
902
|
+
"BodyPronunciationsUploadCsvFileTypedDict",
|
|
903
|
+
"BodyPronunciationsUploadCsvTypedDict",
|
|
890
904
|
"CampaignProperties",
|
|
891
905
|
"Channel",
|
|
892
906
|
"ChannelConfigView",
|
|
@@ -1239,6 +1253,8 @@ __all__ = [
|
|
|
1239
1253
|
"PromptsHistoryRequestTypedDict",
|
|
1240
1254
|
"PromptsListRequest",
|
|
1241
1255
|
"PromptsListRequestTypedDict",
|
|
1256
|
+
"PronunciationsCsvUploadResponse",
|
|
1257
|
+
"PronunciationsCsvUploadResponseTypedDict",
|
|
1242
1258
|
"RequestStatus",
|
|
1243
1259
|
"RoleCreateRequest",
|
|
1244
1260
|
"RoleCreateRequestTypedDict",
|
|
@@ -1466,6 +1482,10 @@ _dynamic_imports: dict[str, str] = {
|
|
|
1466
1482
|
"BodyOutboundBatchUploadFile": ".body_outbound_batch_upload",
|
|
1467
1483
|
"BodyOutboundBatchUploadFileTypedDict": ".body_outbound_batch_upload",
|
|
1468
1484
|
"BodyOutboundBatchUploadTypedDict": ".body_outbound_batch_upload",
|
|
1485
|
+
"BodyPronunciationsUploadCsv": ".body_pronunciations_upload_csv",
|
|
1486
|
+
"BodyPronunciationsUploadCsvFile": ".body_pronunciations_upload_csv",
|
|
1487
|
+
"BodyPronunciationsUploadCsvFileTypedDict": ".body_pronunciations_upload_csv",
|
|
1488
|
+
"BodyPronunciationsUploadCsvTypedDict": ".body_pronunciations_upload_csv",
|
|
1469
1489
|
"CampaignProperties": ".campaignproperties",
|
|
1470
1490
|
"Channel": ".channel",
|
|
1471
1491
|
"ChannelTypedDict": ".channel",
|
|
@@ -1818,6 +1838,8 @@ _dynamic_imports: dict[str, str] = {
|
|
|
1818
1838
|
"PromptsListRequestTypedDict": ".prompts_listop",
|
|
1819
1839
|
"PromptUpdateRequest": ".promptupdaterequest",
|
|
1820
1840
|
"PromptUpdateRequestTypedDict": ".promptupdaterequest",
|
|
1841
|
+
"PronunciationsCsvUploadResponse": ".pronunciationscsvuploadresponse",
|
|
1842
|
+
"PronunciationsCsvUploadResponseTypedDict": ".pronunciationscsvuploadresponse",
|
|
1821
1843
|
"RequestStatus": ".requeststatus",
|
|
1822
1844
|
"RoleCreateRequest": ".rolecreaterequest",
|
|
1823
1845
|
"RoleCreateRequestTypedDict": ".rolecreaterequest",
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
import io
|
|
5
|
+
import pydantic
|
|
6
|
+
from syllable_sdk.types import BaseModel
|
|
7
|
+
from syllable_sdk.utils import FieldMetadata, MultipartFormMetadata
|
|
8
|
+
from typing import IO, Optional, Union
|
|
9
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class BodyPronunciationsUploadCsvFileTypedDict(TypedDict):
|
|
13
|
+
file_name: str
|
|
14
|
+
content: Union[bytes, IO[bytes], io.BufferedReader]
|
|
15
|
+
content_type: NotRequired[str]
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class BodyPronunciationsUploadCsvFile(BaseModel):
|
|
19
|
+
file_name: Annotated[
|
|
20
|
+
str, pydantic.Field(alias="fileName"), FieldMetadata(multipart=True)
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
content: Annotated[
|
|
24
|
+
Union[bytes, IO[bytes], io.BufferedReader],
|
|
25
|
+
pydantic.Field(alias=""),
|
|
26
|
+
FieldMetadata(multipart=MultipartFormMetadata(content=True)),
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
content_type: Annotated[
|
|
30
|
+
Optional[str],
|
|
31
|
+
pydantic.Field(alias="Content-Type"),
|
|
32
|
+
FieldMetadata(multipart=True),
|
|
33
|
+
] = None
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class BodyPronunciationsUploadCsvTypedDict(TypedDict):
|
|
37
|
+
file: BodyPronunciationsUploadCsvFileTypedDict
|
|
38
|
+
r"""CSV file containing pronunciation overrides"""
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class BodyPronunciationsUploadCsv(BaseModel):
|
|
42
|
+
file: Annotated[
|
|
43
|
+
BodyPronunciationsUploadCsvFile,
|
|
44
|
+
FieldMetadata(multipart=MultipartFormMetadata(file=True)),
|
|
45
|
+
]
|
|
46
|
+
r"""CSV file containing pronunciation overrides"""
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from datetime import datetime
|
|
5
|
+
from pydantic import model_serializer
|
|
6
|
+
from syllable_sdk.types import (
|
|
7
|
+
BaseModel,
|
|
8
|
+
Nullable,
|
|
9
|
+
OptionalNullable,
|
|
10
|
+
UNSET,
|
|
11
|
+
UNSET_SENTINEL,
|
|
12
|
+
)
|
|
13
|
+
from typing import Optional
|
|
14
|
+
from typing_extensions import NotRequired, TypedDict
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class PronunciationsCsvUploadResponseTypedDict(TypedDict):
|
|
18
|
+
r"""Placeholder response returned after accepting a pronunciations CSV upload."""
|
|
19
|
+
|
|
20
|
+
revision: int
|
|
21
|
+
hash: NotRequired[Nullable[str]]
|
|
22
|
+
entries: NotRequired[Nullable[int]]
|
|
23
|
+
uploaded_at: NotRequired[datetime]
|
|
24
|
+
uploaded_by: NotRequired[Nullable[str]]
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class PronunciationsCsvUploadResponse(BaseModel):
|
|
28
|
+
r"""Placeholder response returned after accepting a pronunciations CSV upload."""
|
|
29
|
+
|
|
30
|
+
revision: int
|
|
31
|
+
|
|
32
|
+
hash: OptionalNullable[str] = UNSET
|
|
33
|
+
|
|
34
|
+
entries: OptionalNullable[int] = UNSET
|
|
35
|
+
|
|
36
|
+
uploaded_at: Optional[datetime] = None
|
|
37
|
+
|
|
38
|
+
uploaded_by: OptionalNullable[str] = UNSET
|
|
39
|
+
|
|
40
|
+
@model_serializer(mode="wrap")
|
|
41
|
+
def serialize_model(self, handler):
|
|
42
|
+
optional_fields = ["hash", "entries", "uploaded_at", "uploaded_by"]
|
|
43
|
+
nullable_fields = ["hash", "entries", "uploaded_by"]
|
|
44
|
+
null_default_fields = []
|
|
45
|
+
|
|
46
|
+
serialized = handler(self)
|
|
47
|
+
|
|
48
|
+
m = {}
|
|
49
|
+
|
|
50
|
+
for n, f in type(self).model_fields.items():
|
|
51
|
+
k = f.alias or n
|
|
52
|
+
val = serialized.get(k)
|
|
53
|
+
serialized.pop(k, None)
|
|
54
|
+
|
|
55
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
56
|
+
is_set = (
|
|
57
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
58
|
+
or k in null_default_fields
|
|
59
|
+
) # pylint: disable=no-member
|
|
60
|
+
|
|
61
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
62
|
+
m[k] = val
|
|
63
|
+
elif val != UNSET_SENTINEL and (
|
|
64
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
65
|
+
):
|
|
66
|
+
m[k] = val
|
|
67
|
+
|
|
68
|
+
return m
|
syllable_sdk/numbers.py
CHANGED
|
@@ -88,7 +88,7 @@ class Numbers(BaseSDK):
|
|
|
88
88
|
config=self.sdk_configuration,
|
|
89
89
|
base_url=base_url or "",
|
|
90
90
|
operation_id="channels_twilio_numbers_add",
|
|
91
|
-
oauth2_scopes=
|
|
91
|
+
oauth2_scopes=None,
|
|
92
92
|
security_source=get_security_from_env(
|
|
93
93
|
self.sdk_configuration.security, models.Security
|
|
94
94
|
),
|
|
@@ -191,7 +191,7 @@ class Numbers(BaseSDK):
|
|
|
191
191
|
config=self.sdk_configuration,
|
|
192
192
|
base_url=base_url or "",
|
|
193
193
|
operation_id="channels_twilio_numbers_add",
|
|
194
|
-
oauth2_scopes=
|
|
194
|
+
oauth2_scopes=None,
|
|
195
195
|
security_source=get_security_from_env(
|
|
196
196
|
self.sdk_configuration.security, models.Security
|
|
197
197
|
),
|
|
@@ -294,7 +294,7 @@ class Numbers(BaseSDK):
|
|
|
294
294
|
config=self.sdk_configuration,
|
|
295
295
|
base_url=base_url or "",
|
|
296
296
|
operation_id="channels_twilio_numbers_update",
|
|
297
|
-
oauth2_scopes=
|
|
297
|
+
oauth2_scopes=None,
|
|
298
298
|
security_source=get_security_from_env(
|
|
299
299
|
self.sdk_configuration.security, models.Security
|
|
300
300
|
),
|
|
@@ -397,7 +397,7 @@ class Numbers(BaseSDK):
|
|
|
397
397
|
config=self.sdk_configuration,
|
|
398
398
|
base_url=base_url or "",
|
|
399
399
|
operation_id="channels_twilio_numbers_update",
|
|
400
|
-
oauth2_scopes=
|
|
400
|
+
oauth2_scopes=None,
|
|
401
401
|
security_source=get_security_from_env(
|
|
402
402
|
self.sdk_configuration.security, models.Security
|
|
403
403
|
),
|
|
@@ -486,7 +486,7 @@ class Numbers(BaseSDK):
|
|
|
486
486
|
config=self.sdk_configuration,
|
|
487
487
|
base_url=base_url or "",
|
|
488
488
|
operation_id="channels_twilio_numbers_list",
|
|
489
|
-
oauth2_scopes=
|
|
489
|
+
oauth2_scopes=None,
|
|
490
490
|
security_source=get_security_from_env(
|
|
491
491
|
self.sdk_configuration.security, models.Security
|
|
492
492
|
),
|
|
@@ -575,7 +575,7 @@ class Numbers(BaseSDK):
|
|
|
575
575
|
config=self.sdk_configuration,
|
|
576
576
|
base_url=base_url or "",
|
|
577
577
|
operation_id="channels_twilio_numbers_list",
|
|
578
|
-
oauth2_scopes=
|
|
578
|
+
oauth2_scopes=None,
|
|
579
579
|
security_source=get_security_from_env(
|
|
580
580
|
self.sdk_configuration.security, models.Security
|
|
581
581
|
),
|
syllable_sdk/organizations.py
CHANGED
|
@@ -67,7 +67,7 @@ class Organizations(BaseSDK):
|
|
|
67
67
|
config=self.sdk_configuration,
|
|
68
68
|
base_url=base_url or "",
|
|
69
69
|
operation_id="organizations_get",
|
|
70
|
-
oauth2_scopes=
|
|
70
|
+
oauth2_scopes=None,
|
|
71
71
|
security_source=get_security_from_env(
|
|
72
72
|
self.sdk_configuration.security, models.Security
|
|
73
73
|
),
|
|
@@ -143,7 +143,7 @@ class Organizations(BaseSDK):
|
|
|
143
143
|
config=self.sdk_configuration,
|
|
144
144
|
base_url=base_url or "",
|
|
145
145
|
operation_id="organizations_get",
|
|
146
|
-
oauth2_scopes=
|
|
146
|
+
oauth2_scopes=None,
|
|
147
147
|
security_source=get_security_from_env(
|
|
148
148
|
self.sdk_configuration.security, models.Security
|
|
149
149
|
),
|
|
@@ -231,7 +231,7 @@ class Organizations(BaseSDK):
|
|
|
231
231
|
config=self.sdk_configuration,
|
|
232
232
|
base_url=base_url or "",
|
|
233
233
|
operation_id="organizations_update",
|
|
234
|
-
oauth2_scopes=
|
|
234
|
+
oauth2_scopes=None,
|
|
235
235
|
security_source=get_security_from_env(
|
|
236
236
|
self.sdk_configuration.security, models.Security
|
|
237
237
|
),
|
|
@@ -325,7 +325,7 @@ class Organizations(BaseSDK):
|
|
|
325
325
|
config=self.sdk_configuration,
|
|
326
326
|
base_url=base_url or "",
|
|
327
327
|
operation_id="organizations_update",
|
|
328
|
-
oauth2_scopes=
|
|
328
|
+
oauth2_scopes=None,
|
|
329
329
|
security_source=get_security_from_env(
|
|
330
330
|
self.sdk_configuration.security, models.Security
|
|
331
331
|
),
|
|
@@ -419,7 +419,7 @@ class Organizations(BaseSDK):
|
|
|
419
419
|
config=self.sdk_configuration,
|
|
420
420
|
base_url=base_url or "",
|
|
421
421
|
operation_id="organizations_create",
|
|
422
|
-
oauth2_scopes=
|
|
422
|
+
oauth2_scopes=None,
|
|
423
423
|
security_source=get_security_from_env(
|
|
424
424
|
self.sdk_configuration.security, models.Security
|
|
425
425
|
),
|
|
@@ -513,7 +513,7 @@ class Organizations(BaseSDK):
|
|
|
513
513
|
config=self.sdk_configuration,
|
|
514
514
|
base_url=base_url or "",
|
|
515
515
|
operation_id="organizations_create",
|
|
516
|
-
oauth2_scopes=
|
|
516
|
+
oauth2_scopes=None,
|
|
517
517
|
security_source=get_security_from_env(
|
|
518
518
|
self.sdk_configuration.security, models.Security
|
|
519
519
|
),
|
|
@@ -609,7 +609,7 @@ class Organizations(BaseSDK):
|
|
|
609
609
|
config=self.sdk_configuration,
|
|
610
610
|
base_url=base_url or "",
|
|
611
611
|
operation_id="organizations_delete",
|
|
612
|
-
oauth2_scopes=
|
|
612
|
+
oauth2_scopes=None,
|
|
613
613
|
security_source=get_security_from_env(
|
|
614
614
|
self.sdk_configuration.security, models.Security
|
|
615
615
|
),
|
|
@@ -705,7 +705,7 @@ class Organizations(BaseSDK):
|
|
|
705
705
|
config=self.sdk_configuration,
|
|
706
706
|
base_url=base_url or "",
|
|
707
707
|
operation_id="organizations_delete",
|
|
708
|
-
oauth2_scopes=
|
|
708
|
+
oauth2_scopes=None,
|
|
709
709
|
security_source=get_security_from_env(
|
|
710
710
|
self.sdk_configuration.security, models.Security
|
|
711
711
|
),
|
syllable_sdk/permissions.py
CHANGED
|
@@ -67,7 +67,7 @@ class Permissions(BaseSDK):
|
|
|
67
67
|
config=self.sdk_configuration,
|
|
68
68
|
base_url=base_url or "",
|
|
69
69
|
operation_id="permissions_list",
|
|
70
|
-
oauth2_scopes=
|
|
70
|
+
oauth2_scopes=None,
|
|
71
71
|
security_source=get_security_from_env(
|
|
72
72
|
self.sdk_configuration.security, models.Security
|
|
73
73
|
),
|
|
@@ -145,7 +145,7 @@ class Permissions(BaseSDK):
|
|
|
145
145
|
config=self.sdk_configuration,
|
|
146
146
|
base_url=base_url or "",
|
|
147
147
|
operation_id="permissions_list",
|
|
148
|
-
oauth2_scopes=
|
|
148
|
+
oauth2_scopes=None,
|
|
149
149
|
security_source=get_security_from_env(
|
|
150
150
|
self.sdk_configuration.security, models.Security
|
|
151
151
|
),
|
syllable_sdk/prompts.py
CHANGED
|
@@ -98,7 +98,7 @@ class Prompts(BaseSDK):
|
|
|
98
98
|
config=self.sdk_configuration,
|
|
99
99
|
base_url=base_url or "",
|
|
100
100
|
operation_id="prompts_list",
|
|
101
|
-
oauth2_scopes=
|
|
101
|
+
oauth2_scopes=None,
|
|
102
102
|
security_source=get_security_from_env(
|
|
103
103
|
self.sdk_configuration.security, models.Security
|
|
104
104
|
),
|
|
@@ -211,7 +211,7 @@ class Prompts(BaseSDK):
|
|
|
211
211
|
config=self.sdk_configuration,
|
|
212
212
|
base_url=base_url or "",
|
|
213
213
|
operation_id="prompts_list",
|
|
214
|
-
oauth2_scopes=
|
|
214
|
+
oauth2_scopes=None,
|
|
215
215
|
security_source=get_security_from_env(
|
|
216
216
|
self.sdk_configuration.security, models.Security
|
|
217
217
|
),
|
|
@@ -303,7 +303,7 @@ class Prompts(BaseSDK):
|
|
|
303
303
|
config=self.sdk_configuration,
|
|
304
304
|
base_url=base_url or "",
|
|
305
305
|
operation_id="prompts_create",
|
|
306
|
-
oauth2_scopes=
|
|
306
|
+
oauth2_scopes=None,
|
|
307
307
|
security_source=get_security_from_env(
|
|
308
308
|
self.sdk_configuration.security, models.Security
|
|
309
309
|
),
|
|
@@ -395,7 +395,7 @@ class Prompts(BaseSDK):
|
|
|
395
395
|
config=self.sdk_configuration,
|
|
396
396
|
base_url=base_url or "",
|
|
397
397
|
operation_id="prompts_create",
|
|
398
|
-
oauth2_scopes=
|
|
398
|
+
oauth2_scopes=None,
|
|
399
399
|
security_source=get_security_from_env(
|
|
400
400
|
self.sdk_configuration.security, models.Security
|
|
401
401
|
),
|
|
@@ -487,7 +487,7 @@ class Prompts(BaseSDK):
|
|
|
487
487
|
config=self.sdk_configuration,
|
|
488
488
|
base_url=base_url or "",
|
|
489
489
|
operation_id="prompts_update",
|
|
490
|
-
oauth2_scopes=
|
|
490
|
+
oauth2_scopes=None,
|
|
491
491
|
security_source=get_security_from_env(
|
|
492
492
|
self.sdk_configuration.security, models.Security
|
|
493
493
|
),
|
|
@@ -579,7 +579,7 @@ class Prompts(BaseSDK):
|
|
|
579
579
|
config=self.sdk_configuration,
|
|
580
580
|
base_url=base_url or "",
|
|
581
581
|
operation_id="prompts_update",
|
|
582
|
-
oauth2_scopes=
|
|
582
|
+
oauth2_scopes=None,
|
|
583
583
|
security_source=get_security_from_env(
|
|
584
584
|
self.sdk_configuration.security, models.Security
|
|
585
585
|
),
|
|
@@ -668,7 +668,7 @@ class Prompts(BaseSDK):
|
|
|
668
668
|
config=self.sdk_configuration,
|
|
669
669
|
base_url=base_url or "",
|
|
670
670
|
operation_id="prompts_get_by_id",
|
|
671
|
-
oauth2_scopes=
|
|
671
|
+
oauth2_scopes=None,
|
|
672
672
|
security_source=get_security_from_env(
|
|
673
673
|
self.sdk_configuration.security, models.Security
|
|
674
674
|
),
|
|
@@ -757,7 +757,7 @@ class Prompts(BaseSDK):
|
|
|
757
757
|
config=self.sdk_configuration,
|
|
758
758
|
base_url=base_url or "",
|
|
759
759
|
operation_id="prompts_get_by_id",
|
|
760
|
-
oauth2_scopes=
|
|
760
|
+
oauth2_scopes=None,
|
|
761
761
|
security_source=get_security_from_env(
|
|
762
762
|
self.sdk_configuration.security, models.Security
|
|
763
763
|
),
|
|
@@ -849,7 +849,7 @@ class Prompts(BaseSDK):
|
|
|
849
849
|
config=self.sdk_configuration,
|
|
850
850
|
base_url=base_url or "",
|
|
851
851
|
operation_id="prompts_delete",
|
|
852
|
-
oauth2_scopes=
|
|
852
|
+
oauth2_scopes=None,
|
|
853
853
|
security_source=get_security_from_env(
|
|
854
854
|
self.sdk_configuration.security, models.Security
|
|
855
855
|
),
|
|
@@ -941,7 +941,7 @@ class Prompts(BaseSDK):
|
|
|
941
941
|
config=self.sdk_configuration,
|
|
942
942
|
base_url=base_url or "",
|
|
943
943
|
operation_id="prompts_delete",
|
|
944
|
-
oauth2_scopes=
|
|
944
|
+
oauth2_scopes=None,
|
|
945
945
|
security_source=get_security_from_env(
|
|
946
946
|
self.sdk_configuration.security, models.Security
|
|
947
947
|
),
|
|
@@ -1030,7 +1030,7 @@ class Prompts(BaseSDK):
|
|
|
1030
1030
|
config=self.sdk_configuration,
|
|
1031
1031
|
base_url=base_url or "",
|
|
1032
1032
|
operation_id="prompts_history",
|
|
1033
|
-
oauth2_scopes=
|
|
1033
|
+
oauth2_scopes=None,
|
|
1034
1034
|
security_source=get_security_from_env(
|
|
1035
1035
|
self.sdk_configuration.security, models.Security
|
|
1036
1036
|
),
|
|
@@ -1119,7 +1119,7 @@ class Prompts(BaseSDK):
|
|
|
1119
1119
|
config=self.sdk_configuration,
|
|
1120
1120
|
base_url=base_url or "",
|
|
1121
1121
|
operation_id="prompts_history",
|
|
1122
|
-
oauth2_scopes=
|
|
1122
|
+
oauth2_scopes=None,
|
|
1123
1123
|
security_source=get_security_from_env(
|
|
1124
1124
|
self.sdk_configuration.security, models.Security
|
|
1125
1125
|
),
|
|
@@ -1201,7 +1201,7 @@ class Prompts(BaseSDK):
|
|
|
1201
1201
|
config=self.sdk_configuration,
|
|
1202
1202
|
base_url=base_url or "",
|
|
1203
1203
|
operation_id="prompt_get_supported_llms",
|
|
1204
|
-
oauth2_scopes=
|
|
1204
|
+
oauth2_scopes=None,
|
|
1205
1205
|
security_source=get_security_from_env(
|
|
1206
1206
|
self.sdk_configuration.security, models.Security
|
|
1207
1207
|
),
|
|
@@ -1277,7 +1277,7 @@ class Prompts(BaseSDK):
|
|
|
1277
1277
|
config=self.sdk_configuration,
|
|
1278
1278
|
base_url=base_url or "",
|
|
1279
1279
|
operation_id="prompt_get_supported_llms",
|
|
1280
|
-
oauth2_scopes=
|
|
1280
|
+
oauth2_scopes=None,
|
|
1281
1281
|
security_source=get_security_from_env(
|
|
1282
1282
|
self.sdk_configuration.security, models.Security
|
|
1283
1283
|
),
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from .basesdk import BaseSDK
|
|
4
|
+
from syllable_sdk import errors, models, utils
|
|
5
|
+
from syllable_sdk._hooks import HookContext
|
|
6
|
+
from syllable_sdk.types import BaseModel, OptionalNullable, UNSET
|
|
7
|
+
from syllable_sdk.utils import get_security_from_env
|
|
8
|
+
from syllable_sdk.utils.unmarshal_json_response import unmarshal_json_response
|
|
9
|
+
from typing import Any, Mapping, Optional, Union, cast
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class Pronunciations(BaseSDK):
|
|
13
|
+
def pronunciations_upload_csv(
|
|
14
|
+
self,
|
|
15
|
+
*,
|
|
16
|
+
request: Union[
|
|
17
|
+
models.BodyPronunciationsUploadCsv,
|
|
18
|
+
models.BodyPronunciationsUploadCsvTypedDict,
|
|
19
|
+
],
|
|
20
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
21
|
+
server_url: Optional[str] = None,
|
|
22
|
+
timeout_ms: Optional[int] = None,
|
|
23
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
24
|
+
) -> models.PronunciationsCsvUploadResponse:
|
|
25
|
+
r"""Upload Pronunciations Csv
|
|
26
|
+
|
|
27
|
+
:param request: The request object to send.
|
|
28
|
+
:param retries: Override the default retry configuration for this method
|
|
29
|
+
:param server_url: Override the default server URL for this method
|
|
30
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
31
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
32
|
+
"""
|
|
33
|
+
base_url = None
|
|
34
|
+
url_variables = None
|
|
35
|
+
if timeout_ms is None:
|
|
36
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
37
|
+
|
|
38
|
+
if server_url is not None:
|
|
39
|
+
base_url = server_url
|
|
40
|
+
else:
|
|
41
|
+
base_url = self._get_url(base_url, url_variables)
|
|
42
|
+
|
|
43
|
+
if not isinstance(request, BaseModel):
|
|
44
|
+
request = utils.unmarshal(request, models.BodyPronunciationsUploadCsv)
|
|
45
|
+
request = cast(models.BodyPronunciationsUploadCsv, request)
|
|
46
|
+
|
|
47
|
+
req = self._build_request(
|
|
48
|
+
method="POST",
|
|
49
|
+
path="/api/v1/pronunciations/csv",
|
|
50
|
+
base_url=base_url,
|
|
51
|
+
url_variables=url_variables,
|
|
52
|
+
request=request,
|
|
53
|
+
request_body_required=True,
|
|
54
|
+
request_has_path_params=False,
|
|
55
|
+
request_has_query_params=True,
|
|
56
|
+
user_agent_header="user-agent",
|
|
57
|
+
accept_header_value="application/json",
|
|
58
|
+
http_headers=http_headers,
|
|
59
|
+
security=self.sdk_configuration.security,
|
|
60
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
61
|
+
request, False, False, "multipart", models.BodyPronunciationsUploadCsv
|
|
62
|
+
),
|
|
63
|
+
timeout_ms=timeout_ms,
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
if retries == UNSET:
|
|
67
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
68
|
+
retries = self.sdk_configuration.retry_config
|
|
69
|
+
|
|
70
|
+
retry_config = None
|
|
71
|
+
if isinstance(retries, utils.RetryConfig):
|
|
72
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
73
|
+
|
|
74
|
+
http_res = self.do_request(
|
|
75
|
+
hook_ctx=HookContext(
|
|
76
|
+
config=self.sdk_configuration,
|
|
77
|
+
base_url=base_url or "",
|
|
78
|
+
operation_id="pronunciations_upload_csv",
|
|
79
|
+
oauth2_scopes=None,
|
|
80
|
+
security_source=get_security_from_env(
|
|
81
|
+
self.sdk_configuration.security, models.Security
|
|
82
|
+
),
|
|
83
|
+
),
|
|
84
|
+
request=req,
|
|
85
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
86
|
+
retry_config=retry_config,
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
response_data: Any = None
|
|
90
|
+
if utils.match_response(http_res, "202", "application/json"):
|
|
91
|
+
return unmarshal_json_response(
|
|
92
|
+
models.PronunciationsCsvUploadResponse, http_res
|
|
93
|
+
)
|
|
94
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
95
|
+
response_data = unmarshal_json_response(
|
|
96
|
+
errors.HTTPValidationErrorData, http_res
|
|
97
|
+
)
|
|
98
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
99
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
100
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
101
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
102
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
103
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
104
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
105
|
+
|
|
106
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
107
|
+
|
|
108
|
+
async def pronunciations_upload_csv_async(
|
|
109
|
+
self,
|
|
110
|
+
*,
|
|
111
|
+
request: Union[
|
|
112
|
+
models.BodyPronunciationsUploadCsv,
|
|
113
|
+
models.BodyPronunciationsUploadCsvTypedDict,
|
|
114
|
+
],
|
|
115
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
116
|
+
server_url: Optional[str] = None,
|
|
117
|
+
timeout_ms: Optional[int] = None,
|
|
118
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
119
|
+
) -> models.PronunciationsCsvUploadResponse:
|
|
120
|
+
r"""Upload Pronunciations Csv
|
|
121
|
+
|
|
122
|
+
:param request: The request object to send.
|
|
123
|
+
:param retries: Override the default retry configuration for this method
|
|
124
|
+
:param server_url: Override the default server URL for this method
|
|
125
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
126
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
127
|
+
"""
|
|
128
|
+
base_url = None
|
|
129
|
+
url_variables = None
|
|
130
|
+
if timeout_ms is None:
|
|
131
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
132
|
+
|
|
133
|
+
if server_url is not None:
|
|
134
|
+
base_url = server_url
|
|
135
|
+
else:
|
|
136
|
+
base_url = self._get_url(base_url, url_variables)
|
|
137
|
+
|
|
138
|
+
if not isinstance(request, BaseModel):
|
|
139
|
+
request = utils.unmarshal(request, models.BodyPronunciationsUploadCsv)
|
|
140
|
+
request = cast(models.BodyPronunciationsUploadCsv, request)
|
|
141
|
+
|
|
142
|
+
req = self._build_request_async(
|
|
143
|
+
method="POST",
|
|
144
|
+
path="/api/v1/pronunciations/csv",
|
|
145
|
+
base_url=base_url,
|
|
146
|
+
url_variables=url_variables,
|
|
147
|
+
request=request,
|
|
148
|
+
request_body_required=True,
|
|
149
|
+
request_has_path_params=False,
|
|
150
|
+
request_has_query_params=True,
|
|
151
|
+
user_agent_header="user-agent",
|
|
152
|
+
accept_header_value="application/json",
|
|
153
|
+
http_headers=http_headers,
|
|
154
|
+
security=self.sdk_configuration.security,
|
|
155
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
156
|
+
request, False, False, "multipart", models.BodyPronunciationsUploadCsv
|
|
157
|
+
),
|
|
158
|
+
timeout_ms=timeout_ms,
|
|
159
|
+
)
|
|
160
|
+
|
|
161
|
+
if retries == UNSET:
|
|
162
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
163
|
+
retries = self.sdk_configuration.retry_config
|
|
164
|
+
|
|
165
|
+
retry_config = None
|
|
166
|
+
if isinstance(retries, utils.RetryConfig):
|
|
167
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
168
|
+
|
|
169
|
+
http_res = await self.do_request_async(
|
|
170
|
+
hook_ctx=HookContext(
|
|
171
|
+
config=self.sdk_configuration,
|
|
172
|
+
base_url=base_url or "",
|
|
173
|
+
operation_id="pronunciations_upload_csv",
|
|
174
|
+
oauth2_scopes=None,
|
|
175
|
+
security_source=get_security_from_env(
|
|
176
|
+
self.sdk_configuration.security, models.Security
|
|
177
|
+
),
|
|
178
|
+
),
|
|
179
|
+
request=req,
|
|
180
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
181
|
+
retry_config=retry_config,
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
response_data: Any = None
|
|
185
|
+
if utils.match_response(http_res, "202", "application/json"):
|
|
186
|
+
return unmarshal_json_response(
|
|
187
|
+
models.PronunciationsCsvUploadResponse, http_res
|
|
188
|
+
)
|
|
189
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
190
|
+
response_data = unmarshal_json_response(
|
|
191
|
+
errors.HTTPValidationErrorData, http_res
|
|
192
|
+
)
|
|
193
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
194
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
195
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
196
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
197
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
198
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
199
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
200
|
+
|
|
201
|
+
raise errors.APIError("Unexpected response received", http_res)
|