syllable-sdk 0.43.1__py3-none-any.whl → 0.44.1__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.
Files changed (56) hide show
  1. syllable_sdk/_version.py +3 -3
  2. syllable_sdk/agents.py +12 -0
  3. syllable_sdk/basesdk.py +6 -0
  4. syllable_sdk/batches.py +18 -0
  5. syllable_sdk/campaigns.py +10 -0
  6. syllable_sdk/channels.py +8 -0
  7. syllable_sdk/conversation_config.py +411 -0
  8. syllable_sdk/conversations.py +2 -0
  9. syllable_sdk/custom_messages.py +10 -0
  10. syllable_sdk/dashboards.py +12 -0
  11. syllable_sdk/data_sources.py +10 -0
  12. syllable_sdk/directory.py +16 -0
  13. syllable_sdk/events.py +2 -0
  14. syllable_sdk/folders.py +16 -0
  15. syllable_sdk/full_summary.py +2 -0
  16. syllable_sdk/incidents.py +12 -0
  17. syllable_sdk/insights_sdk.py +2 -0
  18. syllable_sdk/insights_tools.py +14 -0
  19. syllable_sdk/language_groups.py +12 -0
  20. syllable_sdk/latency.py +2 -0
  21. syllable_sdk/models/__init__.py +43 -5
  22. syllable_sdk/models/bridgephrasesconfig.py +39 -0
  23. syllable_sdk/models/get_bridge_phrases_configop.py +64 -0
  24. syllable_sdk/models/pronunciationoverridesdictionary.py +6 -3
  25. syllable_sdk/models/schemas_cortex_v1_bridge_phrases_dictionarymetadata.py +67 -0
  26. syllable_sdk/models/{dictionarymetadata.py → schemas_tts_v1_pronunciations_dictionarymetadata.py} +2 -2
  27. syllable_sdk/models/step.py +2 -2
  28. syllable_sdk/models/stepeventactions.py +25 -4
  29. syllable_sdk/models/update_bridge_phrases_configop.py +71 -0
  30. syllable_sdk/numbers.py +6 -0
  31. syllable_sdk/organizations.py +8 -0
  32. syllable_sdk/permissions.py +2 -0
  33. syllable_sdk/prompts.py +14 -0
  34. syllable_sdk/pronunciations.py +18 -4
  35. syllable_sdk/roles.py +10 -0
  36. syllable_sdk/sdk.py +6 -0
  37. syllable_sdk/services.py +10 -0
  38. syllable_sdk/session_debug.py +6 -0
  39. syllable_sdk/session_labels.py +6 -0
  40. syllable_sdk/sessions.py +8 -0
  41. syllable_sdk/takeouts.py +6 -0
  42. syllable_sdk/targets.py +10 -0
  43. syllable_sdk/test.py +2 -0
  44. syllable_sdk/tools.py +10 -0
  45. syllable_sdk/transcript.py +2 -0
  46. syllable_sdk/twilio.py +6 -0
  47. syllable_sdk/users.py +14 -0
  48. syllable_sdk/utils/forms.py +21 -10
  49. syllable_sdk/utils/queryparams.py +14 -2
  50. syllable_sdk/utils/retries.py +69 -5
  51. syllable_sdk/v1.py +14 -0
  52. syllable_sdk/voice_groups.py +12 -0
  53. syllable_sdk/workflows.py +16 -0
  54. {syllable_sdk-0.43.1.dist-info → syllable_sdk-0.44.1.dist-info}/METADATA +6 -1
  55. {syllable_sdk-0.43.1.dist-info → syllable_sdk-0.44.1.dist-info}/RECORD +56 -51
  56. {syllable_sdk-0.43.1.dist-info → syllable_sdk-0.44.1.dist-info}/WHEEL +0 -0
@@ -93,6 +93,7 @@ if TYPE_CHECKING:
93
93
  BodyPronunciationsUploadCsvFileTypedDict,
94
94
  BodyPronunciationsUploadCsvTypedDict,
95
95
  )
96
+ from .bridgephrasesconfig import BridgePhrasesConfig, BridgePhrasesConfigTypedDict
96
97
  from .callaction import (
97
98
  AutoPopulate,
98
99
  AutoPopulateTypedDict,
@@ -272,7 +273,6 @@ if TYPE_CHECKING:
272
273
  from .dialogmessage import DialogMessage, DialogMessageTypedDict
273
274
  from .dialogrole import DialogRole
274
275
  from .dialogtoolcall import DialogToolCall, DialogToolCallTypedDict
275
- from .dictionarymetadata import DictionaryMetadata, DictionaryMetadataTypedDict
276
276
  from .directory_member_deleteop import (
277
277
  DirectoryMemberDeleteRequest,
278
278
  DirectoryMemberDeleteRequestTypedDict,
@@ -348,6 +348,10 @@ if TYPE_CHECKING:
348
348
  GenerateSessionRecordingUrlsRequest,
349
349
  GenerateSessionRecordingUrlsRequestTypedDict,
350
350
  )
351
+ from .get_bridge_phrases_configop import (
352
+ GetBridgePhrasesConfigRequest,
353
+ GetBridgePhrasesConfigRequestTypedDict,
354
+ )
351
355
  from .get_session_data_by_session_idop import (
352
356
  GetSessionDataBySessionIDRequest,
353
357
  GetSessionDataBySessionIDRequestTypedDict,
@@ -824,6 +828,14 @@ if TYPE_CHECKING:
824
828
  SayActionIf2TypedDict,
825
829
  SayActionTypedDict,
826
830
  )
831
+ from .schemas_cortex_v1_bridge_phrases_dictionarymetadata import (
832
+ SchemasCortexV1BridgePhrasesDictionaryMetadata,
833
+ SchemasCortexV1BridgePhrasesDictionaryMetadataTypedDict,
834
+ )
835
+ from .schemas_tts_v1_pronunciations_dictionarymetadata import (
836
+ SchemasTtsV1PronunciationsDictionaryMetadata,
837
+ SchemasTtsV1PronunciationsDictionaryMetadataTypedDict,
838
+ )
827
839
  from .security import Security, SecurityTypedDict
828
840
  from .service_deleteop import ServiceDeleteRequest, ServiceDeleteRequestTypedDict
829
841
  from .service_listop import ServiceListRequest, ServiceListRequestTypedDict
@@ -916,6 +928,8 @@ if TYPE_CHECKING:
916
928
  from .stepeventactions import (
917
929
  Enter,
918
930
  EnterTypedDict,
931
+ Presubmit,
932
+ PresubmitTypedDict,
919
933
  StepEventActions,
920
934
  StepEventActionsStart,
921
935
  StepEventActionsStartTypedDict,
@@ -1022,6 +1036,10 @@ if TYPE_CHECKING:
1022
1036
  TwilioNumberUpdateResponseTypedDict,
1023
1037
  )
1024
1038
  from .twiliophonenumber import TwilioPhoneNumber, TwilioPhoneNumberTypedDict
1039
+ from .update_bridge_phrases_configop import (
1040
+ UpdateBridgePhrasesConfigRequest,
1041
+ UpdateBridgePhrasesConfigRequestTypedDict,
1042
+ )
1025
1043
  from .useractivitystatus import UserActivityStatus
1026
1044
  from .usercreaterequest import UserCreateRequest, UserCreateRequestTypedDict
1027
1045
  from .userdeleterequest import UserDeleteRequest, UserDeleteRequestTypedDict
@@ -1157,6 +1175,8 @@ __all__ = [
1157
1175
  "BodyPronunciationsUploadCsvFile",
1158
1176
  "BodyPronunciationsUploadCsvFileTypedDict",
1159
1177
  "BodyPronunciationsUploadCsvTypedDict",
1178
+ "BridgePhrasesConfig",
1179
+ "BridgePhrasesConfigTypedDict",
1160
1180
  "CallAction",
1161
1181
  "CallActionIf1",
1162
1182
  "CallActionIf1TypedDict",
@@ -1288,8 +1308,6 @@ __all__ = [
1288
1308
  "DialogRole",
1289
1309
  "DialogToolCall",
1290
1310
  "DialogToolCallTypedDict",
1291
- "DictionaryMetadata",
1292
- "DictionaryMetadataTypedDict",
1293
1311
  "DirectoryExtension",
1294
1312
  "DirectoryExtensionNumber",
1295
1313
  "DirectoryExtensionNumberTypedDict",
@@ -1346,6 +1364,8 @@ __all__ = [
1346
1364
  "FolderStatsTypedDict",
1347
1365
  "GenerateSessionRecordingUrlsRequest",
1348
1366
  "GenerateSessionRecordingUrlsRequestTypedDict",
1367
+ "GetBridgePhrasesConfigRequest",
1368
+ "GetBridgePhrasesConfigRequestTypedDict",
1349
1369
  "GetSessionDataBySessionIDRequest",
1350
1370
  "GetSessionDataBySessionIDRequestTypedDict",
1351
1371
  "GetSessionDataBySidRequest",
@@ -1599,6 +1619,8 @@ __all__ = [
1599
1619
  "PostGetDashboardRequestTypedDict",
1600
1620
  "PostListDashboardRequest",
1601
1621
  "PostListDashboardRequestTypedDict",
1622
+ "Presubmit",
1623
+ "PresubmitTypedDict",
1602
1624
  "PromptCreateRequest",
1603
1625
  "PromptCreateRequestTypedDict",
1604
1626
  "PromptHistory",
@@ -1656,6 +1678,10 @@ __all__ = [
1656
1678
  "SayActionIf2",
1657
1679
  "SayActionIf2TypedDict",
1658
1680
  "SayActionTypedDict",
1681
+ "SchemasCortexV1BridgePhrasesDictionaryMetadata",
1682
+ "SchemasCortexV1BridgePhrasesDictionaryMetadataTypedDict",
1683
+ "SchemasTtsV1PronunciationsDictionaryMetadata",
1684
+ "SchemasTtsV1PronunciationsDictionaryMetadataTypedDict",
1659
1685
  "Security",
1660
1686
  "SecurityTypedDict",
1661
1687
  "ServiceCreateRequest",
@@ -1818,6 +1844,8 @@ __all__ = [
1818
1844
  "TwilioNumberUpdateResponseTypedDict",
1819
1845
  "TwilioPhoneNumber",
1820
1846
  "TwilioPhoneNumberTypedDict",
1847
+ "UpdateBridgePhrasesConfigRequest",
1848
+ "UpdateBridgePhrasesConfigRequestTypedDict",
1821
1849
  "UserActivityStatus",
1822
1850
  "UserCreateRequest",
1823
1851
  "UserCreateRequestTypedDict",
@@ -1925,6 +1953,8 @@ _dynamic_imports: dict[str, str] = {
1925
1953
  "BodyPronunciationsUploadCsvFile": ".body_pronunciations_upload_csv",
1926
1954
  "BodyPronunciationsUploadCsvFileTypedDict": ".body_pronunciations_upload_csv",
1927
1955
  "BodyPronunciationsUploadCsvTypedDict": ".body_pronunciations_upload_csv",
1956
+ "BridgePhrasesConfig": ".bridgephrasesconfig",
1957
+ "BridgePhrasesConfigTypedDict": ".bridgephrasesconfig",
1928
1958
  "AutoPopulate": ".callaction",
1929
1959
  "AutoPopulateTypedDict": ".callaction",
1930
1960
  "CallAction": ".callaction",
@@ -2050,8 +2080,6 @@ _dynamic_imports: dict[str, str] = {
2050
2080
  "DialogRole": ".dialogrole",
2051
2081
  "DialogToolCall": ".dialogtoolcall",
2052
2082
  "DialogToolCallTypedDict": ".dialogtoolcall",
2053
- "DictionaryMetadata": ".dictionarymetadata",
2054
- "DictionaryMetadataTypedDict": ".dictionarymetadata",
2055
2083
  "DirectoryMemberDeleteRequest": ".directory_member_deleteop",
2056
2084
  "DirectoryMemberDeleteRequestTypedDict": ".directory_member_deleteop",
2057
2085
  "DirectoryMemberGetByIDRequest": ".directory_member_get_by_idop",
@@ -2106,6 +2134,8 @@ _dynamic_imports: dict[str, str] = {
2106
2134
  "FolderStatsTypedDict": ".folderdetails",
2107
2135
  "GenerateSessionRecordingUrlsRequest": ".generate_session_recording_urlsop",
2108
2136
  "GenerateSessionRecordingUrlsRequestTypedDict": ".generate_session_recording_urlsop",
2137
+ "GetBridgePhrasesConfigRequest": ".get_bridge_phrases_configop",
2138
+ "GetBridgePhrasesConfigRequestTypedDict": ".get_bridge_phrases_configop",
2109
2139
  "GetSessionDataBySessionIDRequest": ".get_session_data_by_session_idop",
2110
2140
  "GetSessionDataBySessionIDRequestTypedDict": ".get_session_data_by_session_idop",
2111
2141
  "GetSessionDataBySidRequest": ".get_session_data_by_sidop",
@@ -2412,6 +2442,10 @@ _dynamic_imports: dict[str, str] = {
2412
2442
  "SayActionIf2": ".sayaction",
2413
2443
  "SayActionIf2TypedDict": ".sayaction",
2414
2444
  "SayActionTypedDict": ".sayaction",
2445
+ "SchemasCortexV1BridgePhrasesDictionaryMetadata": ".schemas_cortex_v1_bridge_phrases_dictionarymetadata",
2446
+ "SchemasCortexV1BridgePhrasesDictionaryMetadataTypedDict": ".schemas_cortex_v1_bridge_phrases_dictionarymetadata",
2447
+ "SchemasTtsV1PronunciationsDictionaryMetadata": ".schemas_tts_v1_pronunciations_dictionarymetadata",
2448
+ "SchemasTtsV1PronunciationsDictionaryMetadataTypedDict": ".schemas_tts_v1_pronunciations_dictionarymetadata",
2415
2449
  "Security": ".security",
2416
2450
  "SecurityTypedDict": ".security",
2417
2451
  "ServiceDeleteRequest": ".service_deleteop",
@@ -2486,6 +2520,8 @@ _dynamic_imports: dict[str, str] = {
2486
2520
  "StepTypedDict": ".step",
2487
2521
  "Enter": ".stepeventactions",
2488
2522
  "EnterTypedDict": ".stepeventactions",
2523
+ "Presubmit": ".stepeventactions",
2524
+ "PresubmitTypedDict": ".stepeventactions",
2489
2525
  "StepEventActions": ".stepeventactions",
2490
2526
  "StepEventActionsStart": ".stepeventactions",
2491
2527
  "StepEventActionsStartTypedDict": ".stepeventactions",
@@ -2577,6 +2613,8 @@ _dynamic_imports: dict[str, str] = {
2577
2613
  "TwilioNumberUpdateResponseTypedDict": ".twilionumberupdateresponse",
2578
2614
  "TwilioPhoneNumber": ".twiliophonenumber",
2579
2615
  "TwilioPhoneNumberTypedDict": ".twiliophonenumber",
2616
+ "UpdateBridgePhrasesConfigRequest": ".update_bridge_phrases_configop",
2617
+ "UpdateBridgePhrasesConfigRequestTypedDict": ".update_bridge_phrases_configop",
2580
2618
  "UserActivityStatus": ".useractivitystatus",
2581
2619
  "UserCreateRequest": ".usercreaterequest",
2582
2620
  "UserCreateRequestTypedDict": ".usercreaterequest",
@@ -0,0 +1,39 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .schemas_cortex_v1_bridge_phrases_dictionarymetadata import (
5
+ SchemasCortexV1BridgePhrasesDictionaryMetadata,
6
+ SchemasCortexV1BridgePhrasesDictionaryMetadataTypedDict,
7
+ )
8
+ from syllable_sdk.types import BaseModel
9
+ from typing import List, Optional
10
+ from typing_extensions import NotRequired, TypedDict
11
+
12
+
13
+ class BridgePhrasesConfigTypedDict(TypedDict):
14
+ r"""Configuration for conversational bridge phrases."""
15
+
16
+ first_slow_messages: NotRequired[List[str]]
17
+ r"""Messages to say when the agent is first delayed."""
18
+ very_slow_messages: NotRequired[List[str]]
19
+ r"""Messages to say when the agent is significantly delayed."""
20
+ tool_responses: NotRequired[List[str]]
21
+ r"""Messages to say when a tool call is in progress."""
22
+ metadata: NotRequired[SchemasCortexV1BridgePhrasesDictionaryMetadataTypedDict]
23
+ r"""Metadata for the bridge phrases dictionary."""
24
+
25
+
26
+ class BridgePhrasesConfig(BaseModel):
27
+ r"""Configuration for conversational bridge phrases."""
28
+
29
+ first_slow_messages: Optional[List[str]] = None
30
+ r"""Messages to say when the agent is first delayed."""
31
+
32
+ very_slow_messages: Optional[List[str]] = None
33
+ r"""Messages to say when the agent is significantly delayed."""
34
+
35
+ tool_responses: Optional[List[str]] = None
36
+ r"""Messages to say when a tool call is in progress."""
37
+
38
+ metadata: Optional[SchemasCortexV1BridgePhrasesDictionaryMetadata] = None
39
+ r"""Metadata for the bridge phrases dictionary."""
@@ -0,0 +1,64 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from pydantic import model_serializer
5
+ from syllable_sdk.types import (
6
+ BaseModel,
7
+ Nullable,
8
+ OptionalNullable,
9
+ UNSET,
10
+ UNSET_SENTINEL,
11
+ )
12
+ from syllable_sdk.utils import FieldMetadata, QueryParamMetadata
13
+ from typing_extensions import Annotated, NotRequired, TypedDict
14
+
15
+
16
+ class GetBridgePhrasesConfigRequestTypedDict(TypedDict):
17
+ agent_id: NotRequired[Nullable[int]]
18
+ r"""Agent ID to fetch config for"""
19
+ tool_name: NotRequired[Nullable[str]]
20
+ r"""Tool name to fetch config for"""
21
+
22
+
23
+ class GetBridgePhrasesConfigRequest(BaseModel):
24
+ agent_id: Annotated[
25
+ OptionalNullable[int],
26
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
27
+ ] = UNSET
28
+ r"""Agent ID to fetch config for"""
29
+
30
+ tool_name: Annotated[
31
+ OptionalNullable[str],
32
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
33
+ ] = UNSET
34
+ r"""Tool name to fetch config for"""
35
+
36
+ @model_serializer(mode="wrap")
37
+ def serialize_model(self, handler):
38
+ optional_fields = ["agent_id", "tool_name"]
39
+ nullable_fields = ["agent_id", "tool_name"]
40
+ null_default_fields = []
41
+
42
+ serialized = handler(self)
43
+
44
+ m = {}
45
+
46
+ for n, f in type(self).model_fields.items():
47
+ k = f.alias or n
48
+ val = serialized.get(k)
49
+ serialized.pop(k, None)
50
+
51
+ optional_nullable = k in optional_fields and k in nullable_fields
52
+ is_set = (
53
+ self.__pydantic_fields_set__.intersection({n})
54
+ or k in null_default_fields
55
+ ) # pylint: disable=no-member
56
+
57
+ if val is not None and val != UNSET_SENTINEL:
58
+ m[k] = val
59
+ elif val != UNSET_SENTINEL and (
60
+ not k in optional_fields or (optional_nullable and is_set)
61
+ ):
62
+ m[k] = val
63
+
64
+ return m
@@ -1,8 +1,11 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
- from .dictionarymetadata import DictionaryMetadata, DictionaryMetadataTypedDict
5
4
  from .pronunciationoverride import PronunciationOverride, PronunciationOverrideTypedDict
5
+ from .schemas_tts_v1_pronunciations_dictionarymetadata import (
6
+ SchemasTtsV1PronunciationsDictionaryMetadata,
7
+ SchemasTtsV1PronunciationsDictionaryMetadataTypedDict,
8
+ )
6
9
  from .voicedisplayinfo import VoiceDisplayInfo, VoiceDisplayInfoTypedDict
7
10
  from syllable_sdk.types import BaseModel
8
11
  from typing import Dict, List, Optional
@@ -32,7 +35,7 @@ class PronunciationOverridesDictionaryTypedDict(TypedDict):
32
35
  """
33
36
 
34
37
  pronunciations: List[PronunciationOverrideTypedDict]
35
- metadata: DictionaryMetadataTypedDict
38
+ metadata: SchemasTtsV1PronunciationsDictionaryMetadataTypedDict
36
39
  r"""Audit metadata associated with a dictionary."""
37
40
  type: NotRequired[str]
38
41
  voices: NotRequired[Dict[str, VoiceDisplayInfoTypedDict]]
@@ -62,7 +65,7 @@ class PronunciationOverridesDictionary(BaseModel):
62
65
 
63
66
  pronunciations: List[PronunciationOverride]
64
67
 
65
- metadata: DictionaryMetadata
68
+ metadata: SchemasTtsV1PronunciationsDictionaryMetadata
66
69
  r"""Audit metadata associated with a dictionary."""
67
70
 
68
71
  type: Optional[str] = "pronunciations_v1"
@@ -0,0 +1,67 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from pydantic import model_serializer
5
+ from syllable_sdk.types import (
6
+ BaseModel,
7
+ Nullable,
8
+ OptionalNullable,
9
+ UNSET,
10
+ UNSET_SENTINEL,
11
+ )
12
+ from typing import Optional
13
+ from typing_extensions import NotRequired, TypedDict
14
+
15
+
16
+ class SchemasCortexV1BridgePhrasesDictionaryMetadataTypedDict(TypedDict):
17
+ r"""Metadata for the bridge phrases dictionary."""
18
+
19
+ hash: NotRequired[Nullable[str]]
20
+ r"""Hash of the dictionary content."""
21
+ source: NotRequired[Nullable[str]]
22
+ r"""Source of the dictionary (e.g. filename)."""
23
+ entries: NotRequired[int]
24
+ r"""Number of entries in the dictionary."""
25
+
26
+
27
+ class SchemasCortexV1BridgePhrasesDictionaryMetadata(BaseModel):
28
+ r"""Metadata for the bridge phrases dictionary."""
29
+
30
+ hash: OptionalNullable[str] = UNSET
31
+ r"""Hash of the dictionary content."""
32
+
33
+ source: OptionalNullable[str] = UNSET
34
+ r"""Source of the dictionary (e.g. filename)."""
35
+
36
+ entries: Optional[int] = 0
37
+ r"""Number of entries in the dictionary."""
38
+
39
+ @model_serializer(mode="wrap")
40
+ def serialize_model(self, handler):
41
+ optional_fields = ["hash", "source", "entries"]
42
+ nullable_fields = ["hash", "source"]
43
+ null_default_fields = []
44
+
45
+ serialized = handler(self)
46
+
47
+ m = {}
48
+
49
+ for n, f in type(self).model_fields.items():
50
+ k = f.alias or n
51
+ val = serialized.get(k)
52
+ serialized.pop(k, None)
53
+
54
+ optional_nullable = k in optional_fields and k in nullable_fields
55
+ is_set = (
56
+ self.__pydantic_fields_set__.intersection({n})
57
+ or k in null_default_fields
58
+ ) # pylint: disable=no-member
59
+
60
+ if val is not None and val != UNSET_SENTINEL:
61
+ m[k] = val
62
+ elif val != UNSET_SENTINEL and (
63
+ not k in optional_fields or (optional_nullable and is_set)
64
+ ):
65
+ m[k] = val
66
+
67
+ return m
@@ -6,7 +6,7 @@ from typing import Optional
6
6
  from typing_extensions import NotRequired, TypedDict
7
7
 
8
8
 
9
- class DictionaryMetadataTypedDict(TypedDict):
9
+ class SchemasTtsV1PronunciationsDictionaryMetadataTypedDict(TypedDict):
10
10
  r"""Audit metadata associated with a dictionary."""
11
11
 
12
12
  entries: int
@@ -14,7 +14,7 @@ class DictionaryMetadataTypedDict(TypedDict):
14
14
  source: NotRequired[str]
15
15
 
16
16
 
17
- class DictionaryMetadata(BaseModel):
17
+ class SchemasTtsV1PronunciationsDictionaryMetadata(BaseModel):
18
18
  r"""Audit metadata associated with a dictionary."""
19
19
 
20
20
  entries: int
@@ -37,7 +37,7 @@ class StepTypedDict(TypedDict):
37
37
  inputs: NotRequired[List[InputParameterTypedDict]]
38
38
  r"""The inputs for the step."""
39
39
  on: NotRequired[StepEventActionsTypedDict]
40
- r"""Actions to perform when events occur (enter, submit)."""
40
+ r"""Actions to perform when events occur (enter, presubmit, submit)."""
41
41
  next: NotRequired[List[NextTypedDict]]
42
42
  r"""The next steps to execute."""
43
43
 
@@ -59,7 +59,7 @@ class Step(BaseModel):
59
59
  r"""The inputs for the step."""
60
60
 
61
61
  on: Optional[StepEventActions] = None
62
- r"""Actions to perform when events occur (enter, submit)."""
62
+ r"""Actions to perform when events occur (enter, presubmit, submit)."""
63
63
 
64
64
  next: Optional[List[Next]] = None
65
65
  r"""The next steps to execute."""
@@ -67,6 +67,22 @@ Enter = Annotated[
67
67
  ]
68
68
 
69
69
 
70
+ PresubmitTypedDict = TypeAliasType(
71
+ "PresubmitTypedDict",
72
+ Union[IncrementActionTypedDict, SaveActionTypedDict, SetValueActionTypedDict],
73
+ )
74
+
75
+
76
+ Presubmit = Annotated[
77
+ Union[
78
+ Annotated[IncrementAction, Tag("inc")],
79
+ Annotated[SaveAction, Tag("save")],
80
+ Annotated[SetValueAction, Tag("set")],
81
+ ],
82
+ Discriminator(lambda m: get_discriminator(m, "action", "action")),
83
+ ]
84
+
85
+
70
86
  StepEventActionsSubmitTypedDict = TypeAliasType(
71
87
  "StepEventActionsSubmitTypedDict",
72
88
  Union[
@@ -92,18 +108,20 @@ StepEventActionsSubmit = Annotated[
92
108
 
93
109
 
94
110
  class StepEventActionsTypedDict(TypedDict):
95
- r"""Actions to perform when events occur (enter, submit)."""
111
+ r"""Actions to perform when events occur (enter, presubmit, submit)."""
96
112
 
97
113
  start: NotRequired[Nullable[List[StepEventActionsStartTypedDict]]]
98
114
  r"""Actions to execute on the first input from the user."""
99
115
  enter: NotRequired[Nullable[List[EnterTypedDict]]]
100
116
  r"""Actions to execute when entering a step (before collecting inputs)."""
117
+ presubmit: NotRequired[Nullable[List[PresubmitTypedDict]]]
118
+ r"""Actions to execute before validation (data-mutation only: set, inc, save). Use this to set default values for required fields that would otherwise fail validation."""
101
119
  submit: NotRequired[Nullable[List[StepEventActionsSubmitTypedDict]]]
102
120
  r"""Actions to execute when the tool/step is submitted by the LLM."""
103
121
 
104
122
 
105
123
  class StepEventActions(BaseModel):
106
- r"""Actions to perform when events occur (enter, submit)."""
124
+ r"""Actions to perform when events occur (enter, presubmit, submit)."""
107
125
 
108
126
  start: OptionalNullable[List[StepEventActionsStart]] = UNSET
109
127
  r"""Actions to execute on the first input from the user."""
@@ -111,13 +129,16 @@ class StepEventActions(BaseModel):
111
129
  enter: OptionalNullable[List[Enter]] = UNSET
112
130
  r"""Actions to execute when entering a step (before collecting inputs)."""
113
131
 
132
+ presubmit: OptionalNullable[List[Presubmit]] = UNSET
133
+ r"""Actions to execute before validation (data-mutation only: set, inc, save). Use this to set default values for required fields that would otherwise fail validation."""
134
+
114
135
  submit: OptionalNullable[List[StepEventActionsSubmit]] = UNSET
115
136
  r"""Actions to execute when the tool/step is submitted by the LLM."""
116
137
 
117
138
  @model_serializer(mode="wrap")
118
139
  def serialize_model(self, handler):
119
- optional_fields = ["start", "enter", "submit"]
120
- nullable_fields = ["start", "enter", "submit"]
140
+ optional_fields = ["start", "enter", "presubmit", "submit"]
141
+ nullable_fields = ["start", "enter", "presubmit", "submit"]
121
142
  null_default_fields = []
122
143
 
123
144
  serialized = handler(self)
@@ -0,0 +1,71 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .bridgephrasesconfig import BridgePhrasesConfig, BridgePhrasesConfigTypedDict
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 syllable_sdk.utils import FieldMetadata, QueryParamMetadata, RequestMetadata
14
+ from typing_extensions import Annotated, NotRequired, TypedDict
15
+
16
+
17
+ class UpdateBridgePhrasesConfigRequestTypedDict(TypedDict):
18
+ bridge_phrases_config: BridgePhrasesConfigTypedDict
19
+ agent_id: NotRequired[Nullable[int]]
20
+ r"""Agent ID to update config for"""
21
+ tool_name: NotRequired[Nullable[str]]
22
+ r"""Tool name to update config for"""
23
+
24
+
25
+ class UpdateBridgePhrasesConfigRequest(BaseModel):
26
+ bridge_phrases_config: Annotated[
27
+ BridgePhrasesConfig,
28
+ FieldMetadata(request=RequestMetadata(media_type="application/json")),
29
+ ]
30
+
31
+ agent_id: Annotated[
32
+ OptionalNullable[int],
33
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
34
+ ] = UNSET
35
+ r"""Agent ID to update config for"""
36
+
37
+ tool_name: Annotated[
38
+ OptionalNullable[str],
39
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
40
+ ] = UNSET
41
+ r"""Tool name to update config for"""
42
+
43
+ @model_serializer(mode="wrap")
44
+ def serialize_model(self, handler):
45
+ optional_fields = ["agent_id", "tool_name"]
46
+ nullable_fields = ["agent_id", "tool_name"]
47
+ null_default_fields = []
48
+
49
+ serialized = handler(self)
50
+
51
+ m = {}
52
+
53
+ for n, f in type(self).model_fields.items():
54
+ k = f.alias or n
55
+ val = serialized.get(k)
56
+ serialized.pop(k, None)
57
+
58
+ optional_nullable = k in optional_fields and k in nullable_fields
59
+ is_set = (
60
+ self.__pydantic_fields_set__.intersection({n})
61
+ or k in null_default_fields
62
+ ) # pylint: disable=no-member
63
+
64
+ if val is not None and val != UNSET_SENTINEL:
65
+ m[k] = val
66
+ elif val != UNSET_SENTINEL and (
67
+ not k in optional_fields or (optional_nullable and is_set)
68
+ ):
69
+ m[k] = val
70
+
71
+ return m
syllable_sdk/numbers.py CHANGED
@@ -72,6 +72,7 @@ class Numbers(BaseSDK):
72
72
  "json",
73
73
  models.TwilioNumberAddRequest,
74
74
  ),
75
+ allow_empty_value=None,
75
76
  timeout_ms=timeout_ms,
76
77
  )
77
78
 
@@ -175,6 +176,7 @@ class Numbers(BaseSDK):
175
176
  "json",
176
177
  models.TwilioNumberAddRequest,
177
178
  ),
179
+ allow_empty_value=None,
178
180
  timeout_ms=timeout_ms,
179
181
  )
180
182
 
@@ -278,6 +280,7 @@ class Numbers(BaseSDK):
278
280
  "json",
279
281
  models.TwilioNumberUpdateRequest,
280
282
  ),
283
+ allow_empty_value=None,
281
284
  timeout_ms=timeout_ms,
282
285
  )
283
286
 
@@ -381,6 +384,7 @@ class Numbers(BaseSDK):
381
384
  "json",
382
385
  models.TwilioNumberUpdateRequest,
383
386
  ),
387
+ allow_empty_value=None,
384
388
  timeout_ms=timeout_ms,
385
389
  )
386
390
 
@@ -470,6 +474,7 @@ class Numbers(BaseSDK):
470
474
  accept_header_value="application/json",
471
475
  http_headers=http_headers,
472
476
  security=self.sdk_configuration.security,
477
+ allow_empty_value=None,
473
478
  timeout_ms=timeout_ms,
474
479
  )
475
480
 
@@ -559,6 +564,7 @@ class Numbers(BaseSDK):
559
564
  accept_header_value="application/json",
560
565
  http_headers=http_headers,
561
566
  security=self.sdk_configuration.security,
567
+ allow_empty_value=None,
562
568
  timeout_ms=timeout_ms,
563
569
  )
564
570
 
@@ -51,6 +51,7 @@ class Organizations(BaseSDK):
51
51
  accept_header_value="application/json",
52
52
  http_headers=http_headers,
53
53
  security=self.sdk_configuration.security,
54
+ allow_empty_value=None,
54
55
  timeout_ms=timeout_ms,
55
56
  )
56
57
 
@@ -127,6 +128,7 @@ class Organizations(BaseSDK):
127
128
  accept_header_value="application/json",
128
129
  http_headers=http_headers,
129
130
  security=self.sdk_configuration.security,
131
+ allow_empty_value=None,
130
132
  timeout_ms=timeout_ms,
131
133
  )
132
134
 
@@ -215,6 +217,7 @@ class Organizations(BaseSDK):
215
217
  get_serialized_body=lambda: utils.serialize_request_body(
216
218
  request, False, False, "multipart", models.BodyOrganizationsUpdate
217
219
  ),
220
+ allow_empty_value=None,
218
221
  timeout_ms=timeout_ms,
219
222
  )
220
223
 
@@ -309,6 +312,7 @@ class Organizations(BaseSDK):
309
312
  get_serialized_body=lambda: utils.serialize_request_body(
310
313
  request, False, False, "multipart", models.BodyOrganizationsUpdate
311
314
  ),
315
+ allow_empty_value=None,
312
316
  timeout_ms=timeout_ms,
313
317
  )
314
318
 
@@ -403,6 +407,7 @@ class Organizations(BaseSDK):
403
407
  get_serialized_body=lambda: utils.serialize_request_body(
404
408
  request, False, False, "multipart", models.BodyOrganizationsCreate
405
409
  ),
410
+ allow_empty_value=None,
406
411
  timeout_ms=timeout_ms,
407
412
  )
408
413
 
@@ -497,6 +502,7 @@ class Organizations(BaseSDK):
497
502
  get_serialized_body=lambda: utils.serialize_request_body(
498
503
  request, False, False, "multipart", models.BodyOrganizationsCreate
499
504
  ),
505
+ allow_empty_value=None,
500
506
  timeout_ms=timeout_ms,
501
507
  )
502
508
 
@@ -593,6 +599,7 @@ class Organizations(BaseSDK):
593
599
  get_serialized_body=lambda: utils.serialize_request_body(
594
600
  request, False, True, "form", Optional[models.BodyOrganizationsDelete]
595
601
  ),
602
+ allow_empty_value=None,
596
603
  timeout_ms=timeout_ms,
597
604
  )
598
605
 
@@ -689,6 +696,7 @@ class Organizations(BaseSDK):
689
696
  get_serialized_body=lambda: utils.serialize_request_body(
690
697
  request, False, True, "form", Optional[models.BodyOrganizationsDelete]
691
698
  ),
699
+ allow_empty_value=None,
692
700
  timeout_ms=timeout_ms,
693
701
  )
694
702
 
@@ -51,6 +51,7 @@ class Permissions(BaseSDK):
51
51
  accept_header_value="application/json",
52
52
  http_headers=http_headers,
53
53
  security=self.sdk_configuration.security,
54
+ allow_empty_value=None,
54
55
  timeout_ms=timeout_ms,
55
56
  )
56
57
 
@@ -129,6 +130,7 @@ class Permissions(BaseSDK):
129
130
  accept_header_value="application/json",
130
131
  http_headers=http_headers,
131
132
  security=self.sdk_configuration.security,
133
+ allow_empty_value=None,
132
134
  timeout_ms=timeout_ms,
133
135
  )
134
136