syllable-sdk 0.36.17__py3-none-any.whl → 0.37.5__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 CHANGED
@@ -3,10 +3,10 @@
3
3
  import importlib.metadata
4
4
 
5
5
  __title__: str = "syllable-sdk"
6
- __version__: str = "0.36.17"
6
+ __version__: str = "0.37.5"
7
7
  __openapi_doc_version__: str = "0.0.2"
8
- __gen_version__: str = "2.709.0"
9
- __user_agent__: str = "speakeasy-sdk/python 0.36.17 2.709.0 0.0.2 syllable-sdk"
8
+ __gen_version__: str = "2.719.3"
9
+ __user_agent__: str = "speakeasy-sdk/python 0.37.5 2.719.3 0.0.2 syllable-sdk"
10
10
 
11
11
  try:
12
12
  if __package__ is not None:
@@ -107,7 +107,6 @@ def close_clients(
107
107
  # to them from the owning SDK instance and they can be reaped.
108
108
  owner.client = None
109
109
  owner.async_client = None
110
-
111
110
  if sync_client is not None and not sync_client_supplied:
112
111
  try:
113
112
  sync_client.close()
@@ -29,6 +29,8 @@ class PromptCreateRequestTypedDict(TypedDict):
29
29
  r"""The prompt text that will be sent to the LLM at the beginning of the conversation"""
30
30
  tools: NotRequired[List[str]]
31
31
  r"""Names of tools to which the prompt has access"""
32
+ session_end_enabled: NotRequired[bool]
33
+ r"""Whether session end functionality is enabled for this prompt"""
32
34
  include_default_tools: NotRequired[bool]
33
35
  r"""Whether to include the default tools (`hangup`) in the list of tools for the prompt. If you disable this during creation, you might want to disable it during updates as well, otherwise the default tools will be added when updating the prompt."""
34
36
 
@@ -54,12 +56,21 @@ class PromptCreateRequest(BaseModel):
54
56
  tools: Optional[List[str]] = None
55
57
  r"""Names of tools to which the prompt has access"""
56
58
 
59
+ session_end_enabled: Optional[bool] = False
60
+ r"""Whether session end functionality is enabled for this prompt"""
61
+
57
62
  include_default_tools: Optional[bool] = True
58
63
  r"""Whether to include the default tools (`hangup`) in the list of tools for the prompt. If you disable this during creation, you might want to disable it during updates as well, otherwise the default tools will be added when updating the prompt."""
59
64
 
60
65
  @model_serializer(mode="wrap")
61
66
  def serialize_model(self, handler):
62
- optional_fields = ["description", "context", "tools", "include_default_tools"]
67
+ optional_fields = [
68
+ "description",
69
+ "context",
70
+ "tools",
71
+ "session_end_enabled",
72
+ "include_default_tools",
73
+ ]
63
74
  nullable_fields = ["description", "context"]
64
75
  null_default_fields = []
65
76
 
@@ -18,3 +18,4 @@ class PromptProperties(str, Enum):
18
18
  LAST_UPDATED = "last_updated"
19
19
  LAST_UPDATED_BY = "last_updated_by"
20
20
  AGENT_COUNT = "agent_count"
21
+ SESSION_END_ENABLED = "session_end_enabled"
@@ -40,6 +40,8 @@ class PromptResponseTypedDict(TypedDict):
40
40
  r"""The prompt text that will be sent to the LLM at the beginning of the conversation"""
41
41
  tools: NotRequired[List[str]]
42
42
  r"""Names of the tools to which the prompt has access (DEPRECATED - use information from full tools field instead)"""
43
+ session_end_enabled: NotRequired[bool]
44
+ r"""Whether session end functionality is enabled for this prompt"""
43
45
  edit_comments: NotRequired[Nullable[str]]
44
46
  r"""The comments for the most recent edit to the prompt"""
45
47
  last_updated_by: NotRequired[Nullable[str]]
@@ -89,6 +91,9 @@ class PromptResponse(BaseModel):
89
91
  ] = None
90
92
  r"""Names of the tools to which the prompt has access (DEPRECATED - use information from full tools field instead)"""
91
93
 
94
+ session_end_enabled: Optional[bool] = False
95
+ r"""Whether session end functionality is enabled for this prompt"""
96
+
92
97
  edit_comments: OptionalNullable[str] = UNSET
93
98
  r"""The comments for the most recent edit to the prompt"""
94
99
 
@@ -110,6 +115,7 @@ class PromptResponse(BaseModel):
110
115
  "description",
111
116
  "context",
112
117
  "tools",
118
+ "session_end_enabled",
113
119
  "edit_comments",
114
120
  "last_updated_by",
115
121
  "agent_count",
@@ -31,6 +31,8 @@ class PromptUpdateRequestTypedDict(TypedDict):
31
31
  r"""The prompt text that will be sent to the LLM at the beginning of the conversation"""
32
32
  tools: NotRequired[List[str]]
33
33
  r"""Names of tools to which the prompt has access"""
34
+ session_end_enabled: NotRequired[bool]
35
+ r"""Whether session end functionality is enabled for this prompt"""
34
36
  edit_comments: NotRequired[Nullable[str]]
35
37
  r"""The comments for the most recent edit to the prompt"""
36
38
  include_default_tools: NotRequired[bool]
@@ -61,6 +63,9 @@ class PromptUpdateRequest(BaseModel):
61
63
  tools: Optional[List[str]] = None
62
64
  r"""Names of tools to which the prompt has access"""
63
65
 
66
+ session_end_enabled: Optional[bool] = False
67
+ r"""Whether session end functionality is enabled for this prompt"""
68
+
64
69
  edit_comments: OptionalNullable[str] = UNSET
65
70
  r"""The comments for the most recent edit to the prompt"""
66
71
 
@@ -73,6 +78,7 @@ class PromptUpdateRequest(BaseModel):
73
78
  "description",
74
79
  "context",
75
80
  "tools",
81
+ "session_end_enabled",
76
82
  "edit_comments",
77
83
  "include_default_tools",
78
84
  ]
syllable_sdk/sdk.py CHANGED
@@ -172,7 +172,7 @@ class SyllableSDK(BaseSDK):
172
172
  """
173
173
  client_supplied = True
174
174
  if client is None:
175
- client = httpx.Client()
175
+ client = httpx.Client(follow_redirects=True)
176
176
  client_supplied = False
177
177
 
178
178
  assert issubclass(
@@ -181,7 +181,7 @@ class SyllableSDK(BaseSDK):
181
181
 
182
182
  async_client_supplied = True
183
183
  if async_client is None:
184
- async_client = httpx.AsyncClient()
184
+ async_client = httpx.AsyncClient(follow_redirects=True)
185
185
  async_client_supplied = False
186
186
 
187
187
  if debug_logger is None:
@@ -3,6 +3,7 @@
3
3
  from enum import Enum
4
4
  from typing import Any, Optional
5
5
 
6
+
6
7
  def get_discriminator(model: Any, fieldname: str, key: str) -> str:
7
8
  """
8
9
  Recursively search for the discriminator attribute in a model.
@@ -25,31 +26,54 @@ def get_discriminator(model: Any, fieldname: str, key: str) -> str:
25
26
 
26
27
  if isinstance(field, dict):
27
28
  if key in field:
28
- return f'{field[key]}'
29
+ return f"{field[key]}"
29
30
 
30
31
  if hasattr(field, fieldname):
31
32
  attr = getattr(field, fieldname)
32
33
  if isinstance(attr, Enum):
33
- return f'{attr.value}'
34
- return f'{attr}'
34
+ return f"{attr.value}"
35
+ return f"{attr}"
35
36
 
36
37
  if hasattr(field, upper_fieldname):
37
38
  attr = getattr(field, upper_fieldname)
38
39
  if isinstance(attr, Enum):
39
- return f'{attr.value}'
40
- return f'{attr}'
40
+ return f"{attr.value}"
41
+ return f"{attr}"
41
42
 
42
43
  return None
43
44
 
45
+ def search_nested_discriminator(obj: Any) -> Optional[str]:
46
+ """Recursively search for discriminator in nested structures."""
47
+ # First try direct field lookup
48
+ discriminator = get_field_discriminator(obj)
49
+ if discriminator is not None:
50
+ return discriminator
51
+
52
+ # If it's a dict, search in nested values
53
+ if isinstance(obj, dict):
54
+ for value in obj.values():
55
+ if isinstance(value, list):
56
+ # Search in list items
57
+ for item in value:
58
+ nested_discriminator = search_nested_discriminator(item)
59
+ if nested_discriminator is not None:
60
+ return nested_discriminator
61
+ elif isinstance(value, dict):
62
+ # Search in nested dict
63
+ nested_discriminator = search_nested_discriminator(value)
64
+ if nested_discriminator is not None:
65
+ return nested_discriminator
66
+
67
+ return None
44
68
 
45
69
  if isinstance(model, list):
46
70
  for field in model:
47
- discriminator = get_field_discriminator(field)
71
+ discriminator = search_nested_discriminator(field)
48
72
  if discriminator is not None:
49
73
  return discriminator
50
74
 
51
- discriminator = get_field_discriminator(model)
75
+ discriminator = search_nested_discriminator(model)
52
76
  if discriminator is not None:
53
77
  return discriminator
54
78
 
55
- raise ValueError(f'Could not find discriminator field {fieldname} in {model}')
79
+ raise ValueError(f"Could not find discriminator field {fieldname} in {model}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: syllable-sdk
3
- Version: 0.36.17
3
+ Version: 0.37.5
4
4
  Summary: Python Client SDK Generated by Speakeasy.
5
5
  Author: Syllable
6
6
  Requires-Python: >=3.9.2
@@ -182,6 +182,7 @@ with SyllableSDK(
182
182
  </br>
183
183
 
184
184
  The same SDK client can also be used to make asynchronous requests by importing asyncio.
185
+
185
186
  ```python
186
187
  # Asynchronous Example
187
188
  import asyncio
@@ -3,7 +3,7 @@ syllable_sdk/_hooks/__init__.py,sha256=9_7W5jAYw8rcO8Kfc-Ty-lB82BHfksAJJpVFb_UeU
3
3
  syllable_sdk/_hooks/registration.py,sha256=1QZB41w6If7I9dXiOSQx6dhSc6BPWrnI5Q5bMOr4iVA,624
4
4
  syllable_sdk/_hooks/sdkhooks.py,sha256=aRu2TMpxilLKDrG6EIy6uQd6IrBH7kaHOoVkd7GIcus,2562
5
5
  syllable_sdk/_hooks/types.py,sha256=uwJkn18g4_rLZhVtKdE6Ed5YcCjGWSqVgN9-PWqV7Ho,3053
6
- syllable_sdk/_version.py,sha256=fjff8MUAQVlylL7OH8X74_WwByaq05T057ym9vNSCa0,470
6
+ syllable_sdk/_version.py,sha256=nnWrHGB65DYWNo1w-o_3pbGmHJDOfhGt9rbiBivvi3U,468
7
7
  syllable_sdk/agents.py,sha256=8Mi55XEKRofGeW9iS5haXK-7wEd7Yo5M2ROH_x5sepQ,46796
8
8
  syllable_sdk/basesdk.py,sha256=PCXez-bS_sOzXpRo7awDMzW4zqGJtktHytrlQfG1HNw,12211
9
9
  syllable_sdk/batches.py,sha256=qgI5PRkdgLdaJl4DPfs4mBJrB0OY_CCDePYntyjleSs,73059
@@ -22,7 +22,7 @@ syllable_sdk/errors/syllablesdkerror.py,sha256=3XR2fsR8p2S7jwhawZW9ly_kzH5Ikf8kr
22
22
  syllable_sdk/events.py,sha256=POKcChr-8dU3XjIcMwlEqAn4BmtBZRzDplMe2r-hI3I,10604
23
23
  syllable_sdk/folders.py,sha256=Yf8zZ3TY38nIWx8HEjmC13KciWxFYHCTUBOzRYAEdZ8,69452
24
24
  syllable_sdk/full_summary.py,sha256=OMOJu6wE6IdiI54w72ljqKYvDbxzXvPu8lgfQhbniz0,7487
25
- syllable_sdk/httpclient.py,sha256=Eu73urOAiZQtdUIyOUnPccxCiBbWEKrXG-JrRG3SLM4,3946
25
+ syllable_sdk/httpclient.py,sha256=dqTPONDBpRn4ktXfcetQiRXnG93f0pJkFhqsYFhLUac,3945
26
26
  syllable_sdk/incidents.py,sha256=mkhdIEED5nBcwz3KvkdrpQEbSbRpKVpvXe4-5vYvqMU,46422
27
27
  syllable_sdk/insights_sdk.py,sha256=i5cYTiUdIrbyB4Nm6xlDFOU6rdM9LeadH4XNzGcNX5E,12078
28
28
  syllable_sdk/insights_tools.py,sha256=SuDEOpPtk7SlsFZ-thzIZSt_31WjofzyzqozseWQy3M,55115
@@ -229,18 +229,18 @@ syllable_sdk/models/permissiongroupresponse.py,sha256=-2y4Mm5p7k8A-oOrqEVrm-XeHV
229
229
  syllable_sdk/models/permissionresponse.py,sha256=UieyRpT5ubQ-08bx3DMdIkGi9KYbJaLe4EOxdg15bVQ,1808
230
230
  syllable_sdk/models/post_get_dashboardop.py,sha256=hJgtyzQsZ9Qyc5mqpfULcwHqXyAM8JucU5qRq6_VJ9g,504
231
231
  syllable_sdk/models/post_list_dashboardop.py,sha256=5A9ntb9WgxBqwysitzuz9rL1rETjfXsxw_L6Ytho3Gg,5055
232
- syllable_sdk/models/promptcreaterequest.py,sha256=n9Yzm2O7-x1obUTQA35w5S7qYttOOh7DSAGhNGsIOvI,3149
232
+ syllable_sdk/models/promptcreaterequest.py,sha256=ZV4Jff4ovByQTbtvhx5uQGUIg70KFfMcVJ4yZovG0nQ,3479
233
233
  syllable_sdk/models/prompthistory.py,sha256=pjqX8zjgVPrqrX5ax_ezMuTSeFS_aWmzRelHepJP7-E,4086
234
234
  syllable_sdk/models/prompthistorylinkedtool.py,sha256=gVLskq9wKSPlaXadgWc6o2ELdKOvqSZIOoUx9RXpVBQ,1351
235
235
  syllable_sdk/models/promptllmconfig.py,sha256=l231V2X2d42PrRAhC0xImKTWJBmcAztRrgGeprvtfqI,3213
236
236
  syllable_sdk/models/promptllmprovider.py,sha256=nkDRxVE2qld5aX-rSyDO1KpD1nv5OVVEvxVQnl7VWUY,276
237
- syllable_sdk/models/promptproperties.py,sha256=C9c3NRaEAx-ml5XkFYP2UxDm9QauYs7rawgrUYeGFGY,568
238
- syllable_sdk/models/promptresponse.py,sha256=kJAnFpGBuTdkv7uNv7RTg0qydwHIb4II2yB-2BG_K5k,5466
237
+ syllable_sdk/models/promptproperties.py,sha256=wOMjHbnxTiUDA9VJPTiBqkYHsxy9LDV0LMEim0aQ0KU,616
238
+ syllable_sdk/models/promptresponse.py,sha256=HMfVzFKQ9q1IGgFU6toNWaCLWEMWj3lbKIcubcg4lUc,5737
239
239
  syllable_sdk/models/prompts_deleteop.py,sha256=gw1CB5A5Fd1CTaSMlQSDtJc0ZMKju7XcR-BnNZzWLDU,635
240
240
  syllable_sdk/models/prompts_get_by_idop.py,sha256=r-ugo1ui1v-5Ns9dbDNuB_0R7-QD9aKUebT6noQHDVg,490
241
241
  syllable_sdk/models/prompts_historyop.py,sha256=psp95NjtZ-G1ItE6AUgNO8OgZ0nh2vu8HZ7zK8vz9MY,490
242
242
  syllable_sdk/models/prompts_listop.py,sha256=s9iHPBo_MDmtVvwh3bqEFSgxmNVUqjNebO83MARe_W0,5019
243
- syllable_sdk/models/promptupdaterequest.py,sha256=yWaqbeh7BDdZS3iWFKthwQBMAh-cHKZNNFbUyUxqoUE,3577
243
+ syllable_sdk/models/promptupdaterequest.py,sha256=8Dykjiv5VgLy_3qB9Opt4Dp1DSzD-FPk7FiVFL6NHaA,3848
244
244
  syllable_sdk/models/requeststatus.py,sha256=1cyc-rx4ZAOqUbgiv0e7EzaVudBk5C-pOfpjrXuVTJc,391
245
245
  syllable_sdk/models/rolecreaterequest.py,sha256=6p4WSFxwIeQrDvAy5hqu2_bSMC5o2IvgkX6I3_Tn_iY,1990
246
246
  syllable_sdk/models/roleproperties.py,sha256=Qh7Bh9iU_fk6iTahufCdsW-W8aa1MaLb94Z9gv3p9us,368
@@ -339,7 +339,7 @@ syllable_sdk/permissions.py,sha256=EGDOu1toJfNgAEfS4Uv5QdWTPKvnPkH_DWGXDQdDhkk,6
339
339
  syllable_sdk/prompts.py,sha256=stz81yOmM22ehTiWUm1GqHcrtoPG9Cgw8J9ET32AtRM,53344
340
340
  syllable_sdk/py.typed,sha256=zrp19r0G21lr2yRiMC0f8MFkQFGj9wMpSbboePMg8KM,59
341
341
  syllable_sdk/roles.py,sha256=wfAePzjeRItms1lvXIKZo73PdGZnzNn1SgjyMSKqdxc,40374
342
- syllable_sdk/sdk.py,sha256=7qR2MaxS7vBWJjnrz3MibNNDLbZO5MbNXAtovOR6-5g,16263
342
+ syllable_sdk/sdk.py,sha256=nPUh5ruLzxusD4C9xDX5l1TF8iO4zZLgZafCD6ZXHKk,16305
343
343
  syllable_sdk/sdkconfiguration.py,sha256=cbYqSx5Sw6bPo2RiqBsU6OkBJnBBVJ6pNORhPyaTHkg,1594
344
344
  syllable_sdk/services.py,sha256=sI0gG_Xa4XnDMU0B05q__UPs2LCYTNbkrvM_FuoXhgY,40271
345
345
  syllable_sdk/session_debug.py,sha256=wKqcDWjexF_k3BtZ4whViJOZtwUhVRoNrv22YI9kxTM,22188
@@ -355,7 +355,7 @@ syllable_sdk/types/__init__.py,sha256=RArOwSgeeTIva6h-4ttjXwMUeCkz10nAFBL9D-QljI
355
355
  syllable_sdk/types/basemodel.py,sha256=L79WXvTECbSqaJzs8D3ud_KdIWkU7Cx2wbohDAktE9E,1127
356
356
  syllable_sdk/users.py,sha256=CQTR_esL0vCzwc3Z98c7vw2ZGIdHD1RZ4KI6cw6CH0g,53451
357
357
  syllable_sdk/utils/__init__.py,sha256=CAG0O76aEToGKXpT6Ft87Vd-iiQTh4XdBrQ37BVbsiM,5861
358
- syllable_sdk/utils/annotations.py,sha256=aR7mZG34FzgRdew7WZPYEu9QGBerpuKxCF4sek5Z_5Y,1699
358
+ syllable_sdk/utils/annotations.py,sha256=FvfvVTUj8TUclm4HbGgY5yi2Ap7EzGmu2UPFU4FwC1w,2755
359
359
  syllable_sdk/utils/datetimes.py,sha256=oppAA5e3V35pQov1-FNLKxAaNF1_XWi-bQtyjjql3H8,855
360
360
  syllable_sdk/utils/enums.py,sha256=REU6ydF8gsVL3xaeGX4sMNyiL3q5P9h29-f6Sa6luAE,2633
361
361
  syllable_sdk/utils/eventstreaming.py,sha256=SgFqMcUOYKlrTQ4gAp_dNcKLvDXukeiEMNU3DP8mXk8,6692
@@ -373,6 +373,6 @@ syllable_sdk/utils/url.py,sha256=BgGPgcTA6MRK4bF8fjP2dUopN3NzEzxWMXPBVg8NQUA,525
373
373
  syllable_sdk/utils/values.py,sha256=CcaCXEa3xHhkUDROyXZocN8f0bdITftv9Y0P9lTf0YM,3517
374
374
  syllable_sdk/v1.py,sha256=zMPQz7GtZxDuziCcmhKk2IS7EfiaW9WfiSIqAGbb-o4,53448
375
375
  syllable_sdk/workflows.py,sha256=kQPJzssdldotkipoWzu1ddas4IKbpFdXkGFDwDkWt1M,64777
376
- syllable_sdk-0.36.17.dist-info/METADATA,sha256=CjxKwis3_8duxoCWWz1SsLBF7NL3NsqlcQKS2hZ7rew,46217
377
- syllable_sdk-0.36.17.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
378
- syllable_sdk-0.36.17.dist-info/RECORD,,
376
+ syllable_sdk-0.37.5.dist-info/METADATA,sha256=Ot2IZXqUaDTobCEcZadu0TsjSo1DkCPi5LAghpTDkJw,46217
377
+ syllable_sdk-0.37.5.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
378
+ syllable_sdk-0.37.5.dist-info/RECORD,,