syllable-sdk 0.35.33__py3-none-any.whl → 0.35.38__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 +23 -26
- syllable_sdk/batches.py +37 -36
- syllable_sdk/campaigns.py +21 -20
- syllable_sdk/channels.py +9 -8
- syllable_sdk/conversations.py +5 -8
- syllable_sdk/custom_messages.py +21 -20
- syllable_sdk/dashboards.py +17 -20
- syllable_sdk/data_sources.py +21 -32
- syllable_sdk/events.py +5 -4
- syllable_sdk/folders.py +33 -40
- syllable_sdk/full_summary.py +5 -8
- syllable_sdk/incidents.py +23 -22
- syllable_sdk/insights_sdk.py +5 -8
- syllable_sdk/insights_tools.py +27 -30
- syllable_sdk/language_groups.py +23 -22
- syllable_sdk/latency.py +5 -8
- syllable_sdk/models/agentsttprovider.py +1 -1
- syllable_sdk/models/insightworkflowcondition.py +8 -1
- syllable_sdk/models/insightworkflowinput.py +10 -10
- syllable_sdk/models/insightworkflowoutput.py +10 -10
- syllable_sdk/numbers.py +13 -24
- syllable_sdk/organizations.py +15 -14
- syllable_sdk/permissions.py +3 -2
- syllable_sdk/prompts.py +27 -30
- syllable_sdk/roles.py +21 -24
- syllable_sdk/sdk.py +23 -8
- syllable_sdk/services.py +21 -24
- syllable_sdk/session_debug.py +13 -12
- syllable_sdk/session_labels.py +13 -16
- syllable_sdk/sessions.py +15 -18
- syllable_sdk/takeouts.py +9 -8
- syllable_sdk/targets.py +21 -24
- syllable_sdk/test.py +5 -4
- syllable_sdk/tools.py +21 -24
- syllable_sdk/transcript.py +5 -4
- syllable_sdk/twilio.py +13 -12
- syllable_sdk/users.py +27 -30
- syllable_sdk/utils/__init__.py +0 -3
- syllable_sdk/utils/serializers.py +1 -18
- syllable_sdk/utils/unmarshal_json_response.py +24 -0
- syllable_sdk/v1.py +27 -30
- syllable_sdk/workflows.py +33 -32
- {syllable_sdk-0.35.33.dist-info → syllable_sdk-0.35.38.dist-info}/METADATA +24 -8
- {syllable_sdk-0.35.33.dist-info → syllable_sdk-0.35.38.dist-info}/RECORD +46 -45
- {syllable_sdk-0.35.33.dist-info → syllable_sdk-0.35.38.dist-info}/WHEEL +0 -0
|
@@ -24,17 +24,17 @@ class InsightWorkflowInputTypedDict(TypedDict):
|
|
|
24
24
|
name: str
|
|
25
25
|
r"""Human-readable name of insight workflow"""
|
|
26
26
|
source: str
|
|
27
|
-
r"""Source of the
|
|
27
|
+
r"""Source of the workflow"""
|
|
28
28
|
description: str
|
|
29
|
-
r"""Text description of
|
|
29
|
+
r"""Text description of workflow"""
|
|
30
30
|
insight_tool_ids: List[int]
|
|
31
|
-
r"""
|
|
31
|
+
r"""Ordered list of IDs of tool configurations to be executed in the workflow"""
|
|
32
32
|
conditions: InsightWorkflowConditionTypedDict
|
|
33
33
|
r"""Model for the conditions that trigger an insight workflow."""
|
|
34
34
|
start_datetime: NotRequired[Nullable[datetime]]
|
|
35
|
-
r"""
|
|
35
|
+
r"""Target session timestamp the workflow (backfill) should start. An empty value indicates start on activation - live sessions only"""
|
|
36
36
|
end_datetime: NotRequired[Nullable[datetime]]
|
|
37
|
-
r"""
|
|
37
|
+
r"""Target session timestamp the workflow (backfill) should end. An empty value indicates no end, i.e., include live sessions until deactivation"""
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
class InsightWorkflowInput(BaseModel):
|
|
@@ -44,22 +44,22 @@ class InsightWorkflowInput(BaseModel):
|
|
|
44
44
|
r"""Human-readable name of insight workflow"""
|
|
45
45
|
|
|
46
46
|
source: str
|
|
47
|
-
r"""Source of the
|
|
47
|
+
r"""Source of the workflow"""
|
|
48
48
|
|
|
49
49
|
description: str
|
|
50
|
-
r"""Text description of
|
|
50
|
+
r"""Text description of workflow"""
|
|
51
51
|
|
|
52
52
|
insight_tool_ids: List[int]
|
|
53
|
-
r"""
|
|
53
|
+
r"""Ordered list of IDs of tool configurations to be executed in the workflow"""
|
|
54
54
|
|
|
55
55
|
conditions: InsightWorkflowCondition
|
|
56
56
|
r"""Model for the conditions that trigger an insight workflow."""
|
|
57
57
|
|
|
58
58
|
start_datetime: OptionalNullable[datetime] = UNSET
|
|
59
|
-
r"""
|
|
59
|
+
r"""Target session timestamp the workflow (backfill) should start. An empty value indicates start on activation - live sessions only"""
|
|
60
60
|
|
|
61
61
|
end_datetime: OptionalNullable[datetime] = UNSET
|
|
62
|
-
r"""
|
|
62
|
+
r"""Target session timestamp the workflow (backfill) should end. An empty value indicates no end, i.e., include live sessions until deactivation"""
|
|
63
63
|
|
|
64
64
|
@model_serializer(mode="wrap")
|
|
65
65
|
def serialize_model(self, handler):
|
|
@@ -29,11 +29,11 @@ class InsightWorkflowOutputTypedDict(TypedDict):
|
|
|
29
29
|
name: str
|
|
30
30
|
r"""Human-readable name of insight workflow"""
|
|
31
31
|
source: str
|
|
32
|
-
r"""Source of the
|
|
32
|
+
r"""Source of the workflow"""
|
|
33
33
|
description: str
|
|
34
|
-
r"""Text description of
|
|
34
|
+
r"""Text description of workflow"""
|
|
35
35
|
insight_tool_ids: List[int]
|
|
36
|
-
r"""
|
|
36
|
+
r"""Ordered list of IDs of tool configurations to be executed in the workflow"""
|
|
37
37
|
conditions: InsightWorkflowConditionTypedDict
|
|
38
38
|
r"""Model for the conditions that trigger an insight workflow."""
|
|
39
39
|
id: int
|
|
@@ -47,9 +47,9 @@ class InsightWorkflowOutputTypedDict(TypedDict):
|
|
|
47
47
|
last_updated_by: str
|
|
48
48
|
r"""Email of user who last updated Insight Workflow"""
|
|
49
49
|
start_datetime: NotRequired[Nullable[datetime]]
|
|
50
|
-
r"""
|
|
50
|
+
r"""Target session timestamp the workflow (backfill) should start. An empty value indicates start on activation - live sessions only"""
|
|
51
51
|
end_datetime: NotRequired[Nullable[datetime]]
|
|
52
|
-
r"""
|
|
52
|
+
r"""Target session timestamp the workflow (backfill) should end. An empty value indicates no end, i.e., include live sessions until deactivation"""
|
|
53
53
|
queue_count: NotRequired[Nullable[int]]
|
|
54
54
|
r"""Number of calls in the workflow queue (pending or processing)"""
|
|
55
55
|
created_at: NotRequired[datetime]
|
|
@@ -65,13 +65,13 @@ class InsightWorkflowOutput(BaseModel):
|
|
|
65
65
|
r"""Human-readable name of insight workflow"""
|
|
66
66
|
|
|
67
67
|
source: str
|
|
68
|
-
r"""Source of the
|
|
68
|
+
r"""Source of the workflow"""
|
|
69
69
|
|
|
70
70
|
description: str
|
|
71
|
-
r"""Text description of
|
|
71
|
+
r"""Text description of workflow"""
|
|
72
72
|
|
|
73
73
|
insight_tool_ids: List[int]
|
|
74
|
-
r"""
|
|
74
|
+
r"""Ordered list of IDs of tool configurations to be executed in the workflow"""
|
|
75
75
|
|
|
76
76
|
conditions: InsightWorkflowCondition
|
|
77
77
|
r"""Model for the conditions that trigger an insight workflow."""
|
|
@@ -92,10 +92,10 @@ class InsightWorkflowOutput(BaseModel):
|
|
|
92
92
|
r"""Email of user who last updated Insight Workflow"""
|
|
93
93
|
|
|
94
94
|
start_datetime: OptionalNullable[datetime] = UNSET
|
|
95
|
-
r"""
|
|
95
|
+
r"""Target session timestamp the workflow (backfill) should start. An empty value indicates start on activation - live sessions only"""
|
|
96
96
|
|
|
97
97
|
end_datetime: OptionalNullable[datetime] = UNSET
|
|
98
|
-
r"""
|
|
98
|
+
r"""Target session timestamp the workflow (backfill) should end. An empty value indicates no end, i.e., include live sessions until deactivation"""
|
|
99
99
|
|
|
100
100
|
queue_count: OptionalNullable[int] = UNSET
|
|
101
101
|
r"""Number of calls in the workflow queue (pending or processing)"""
|
syllable_sdk/numbers.py
CHANGED
|
@@ -5,6 +5,7 @@ from syllable_sdk import errors, models, utils
|
|
|
5
5
|
from syllable_sdk._hooks import HookContext
|
|
6
6
|
from syllable_sdk.types import OptionalNullable, UNSET
|
|
7
7
|
from syllable_sdk.utils import get_security_from_env
|
|
8
|
+
from syllable_sdk.utils.unmarshal_json_response import unmarshal_json_response
|
|
8
9
|
from typing import Any, Mapping, Optional, Union
|
|
9
10
|
|
|
10
11
|
|
|
@@ -99,11 +100,9 @@ class Numbers(BaseSDK):
|
|
|
99
100
|
|
|
100
101
|
response_data: Any = None
|
|
101
102
|
if utils.match_response(http_res, "200", "application/json"):
|
|
102
|
-
return
|
|
103
|
-
models.TwilioNumberAddResponse, http_res
|
|
104
|
-
)
|
|
103
|
+
return unmarshal_json_response(models.TwilioNumberAddResponse, http_res)
|
|
105
104
|
if utils.match_response(http_res, "422", "application/json"):
|
|
106
|
-
response_data =
|
|
105
|
+
response_data = unmarshal_json_response(
|
|
107
106
|
errors.HTTPValidationErrorData, http_res
|
|
108
107
|
)
|
|
109
108
|
raise errors.HTTPValidationError(response_data, http_res)
|
|
@@ -204,11 +203,9 @@ class Numbers(BaseSDK):
|
|
|
204
203
|
|
|
205
204
|
response_data: Any = None
|
|
206
205
|
if utils.match_response(http_res, "200", "application/json"):
|
|
207
|
-
return
|
|
208
|
-
models.TwilioNumberAddResponse, http_res
|
|
209
|
-
)
|
|
206
|
+
return unmarshal_json_response(models.TwilioNumberAddResponse, http_res)
|
|
210
207
|
if utils.match_response(http_res, "422", "application/json"):
|
|
211
|
-
response_data =
|
|
208
|
+
response_data = unmarshal_json_response(
|
|
212
209
|
errors.HTTPValidationErrorData, http_res
|
|
213
210
|
)
|
|
214
211
|
raise errors.HTTPValidationError(response_data, http_res)
|
|
@@ -309,11 +306,9 @@ class Numbers(BaseSDK):
|
|
|
309
306
|
|
|
310
307
|
response_data: Any = None
|
|
311
308
|
if utils.match_response(http_res, "200", "application/json"):
|
|
312
|
-
return
|
|
313
|
-
models.TwilioNumberUpdateResponse, http_res
|
|
314
|
-
)
|
|
309
|
+
return unmarshal_json_response(models.TwilioNumberUpdateResponse, http_res)
|
|
315
310
|
if utils.match_response(http_res, "422", "application/json"):
|
|
316
|
-
response_data =
|
|
311
|
+
response_data = unmarshal_json_response(
|
|
317
312
|
errors.HTTPValidationErrorData, http_res
|
|
318
313
|
)
|
|
319
314
|
raise errors.HTTPValidationError(response_data, http_res)
|
|
@@ -414,11 +409,9 @@ class Numbers(BaseSDK):
|
|
|
414
409
|
|
|
415
410
|
response_data: Any = None
|
|
416
411
|
if utils.match_response(http_res, "200", "application/json"):
|
|
417
|
-
return
|
|
418
|
-
models.TwilioNumberUpdateResponse, http_res
|
|
419
|
-
)
|
|
412
|
+
return unmarshal_json_response(models.TwilioNumberUpdateResponse, http_res)
|
|
420
413
|
if utils.match_response(http_res, "422", "application/json"):
|
|
421
|
-
response_data =
|
|
414
|
+
response_data = unmarshal_json_response(
|
|
422
415
|
errors.HTTPValidationErrorData, http_res
|
|
423
416
|
)
|
|
424
417
|
raise errors.HTTPValidationError(response_data, http_res)
|
|
@@ -505,11 +498,9 @@ class Numbers(BaseSDK):
|
|
|
505
498
|
|
|
506
499
|
response_data: Any = None
|
|
507
500
|
if utils.match_response(http_res, "200", "application/json"):
|
|
508
|
-
return
|
|
509
|
-
models.TwilioListNumbersResponse, http_res
|
|
510
|
-
)
|
|
501
|
+
return unmarshal_json_response(models.TwilioListNumbersResponse, http_res)
|
|
511
502
|
if utils.match_response(http_res, "422", "application/json"):
|
|
512
|
-
response_data =
|
|
503
|
+
response_data = unmarshal_json_response(
|
|
513
504
|
errors.HTTPValidationErrorData, http_res
|
|
514
505
|
)
|
|
515
506
|
raise errors.HTTPValidationError(response_data, http_res)
|
|
@@ -596,11 +587,9 @@ class Numbers(BaseSDK):
|
|
|
596
587
|
|
|
597
588
|
response_data: Any = None
|
|
598
589
|
if utils.match_response(http_res, "200", "application/json"):
|
|
599
|
-
return
|
|
600
|
-
models.TwilioListNumbersResponse, http_res
|
|
601
|
-
)
|
|
590
|
+
return unmarshal_json_response(models.TwilioListNumbersResponse, http_res)
|
|
602
591
|
if utils.match_response(http_res, "422", "application/json"):
|
|
603
|
-
response_data =
|
|
592
|
+
response_data = unmarshal_json_response(
|
|
604
593
|
errors.HTTPValidationErrorData, http_res
|
|
605
594
|
)
|
|
606
595
|
raise errors.HTTPValidationError(response_data, http_res)
|
syllable_sdk/organizations.py
CHANGED
|
@@ -5,6 +5,7 @@ from syllable_sdk import errors, models, utils
|
|
|
5
5
|
from syllable_sdk._hooks import HookContext
|
|
6
6
|
from syllable_sdk.types import BaseModel, OptionalNullable, UNSET
|
|
7
7
|
from syllable_sdk.utils import get_security_from_env
|
|
8
|
+
from syllable_sdk.utils.unmarshal_json_response import unmarshal_json_response
|
|
8
9
|
from typing import Any, Mapping, Optional, Union, cast
|
|
9
10
|
|
|
10
11
|
|
|
@@ -77,7 +78,7 @@ class Organizations(BaseSDK):
|
|
|
77
78
|
)
|
|
78
79
|
|
|
79
80
|
if utils.match_response(http_res, "200", "application/json"):
|
|
80
|
-
return
|
|
81
|
+
return unmarshal_json_response(models.OrganizationResponse, http_res)
|
|
81
82
|
if utils.match_response(http_res, "4XX", "*"):
|
|
82
83
|
http_res_text = utils.stream_to_text(http_res)
|
|
83
84
|
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
@@ -153,7 +154,7 @@ class Organizations(BaseSDK):
|
|
|
153
154
|
)
|
|
154
155
|
|
|
155
156
|
if utils.match_response(http_res, "200", "application/json"):
|
|
156
|
-
return
|
|
157
|
+
return unmarshal_json_response(models.OrganizationResponse, http_res)
|
|
157
158
|
if utils.match_response(http_res, "4XX", "*"):
|
|
158
159
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
159
160
|
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
@@ -242,9 +243,9 @@ class Organizations(BaseSDK):
|
|
|
242
243
|
|
|
243
244
|
response_data: Any = None
|
|
244
245
|
if utils.match_response(http_res, "200", "application/json"):
|
|
245
|
-
return
|
|
246
|
+
return unmarshal_json_response(models.OrganizationResponse, http_res)
|
|
246
247
|
if utils.match_response(http_res, "422", "application/json"):
|
|
247
|
-
response_data =
|
|
248
|
+
response_data = unmarshal_json_response(
|
|
248
249
|
errors.HTTPValidationErrorData, http_res
|
|
249
250
|
)
|
|
250
251
|
raise errors.HTTPValidationError(response_data, http_res)
|
|
@@ -336,9 +337,9 @@ class Organizations(BaseSDK):
|
|
|
336
337
|
|
|
337
338
|
response_data: Any = None
|
|
338
339
|
if utils.match_response(http_res, "200", "application/json"):
|
|
339
|
-
return
|
|
340
|
+
return unmarshal_json_response(models.OrganizationResponse, http_res)
|
|
340
341
|
if utils.match_response(http_res, "422", "application/json"):
|
|
341
|
-
response_data =
|
|
342
|
+
response_data = unmarshal_json_response(
|
|
342
343
|
errors.HTTPValidationErrorData, http_res
|
|
343
344
|
)
|
|
344
345
|
raise errors.HTTPValidationError(response_data, http_res)
|
|
@@ -430,9 +431,9 @@ class Organizations(BaseSDK):
|
|
|
430
431
|
|
|
431
432
|
response_data: Any = None
|
|
432
433
|
if utils.match_response(http_res, "200", "application/json"):
|
|
433
|
-
return
|
|
434
|
+
return unmarshal_json_response(models.OrganizationResponse, http_res)
|
|
434
435
|
if utils.match_response(http_res, "422", "application/json"):
|
|
435
|
-
response_data =
|
|
436
|
+
response_data = unmarshal_json_response(
|
|
436
437
|
errors.HTTPValidationErrorData, http_res
|
|
437
438
|
)
|
|
438
439
|
raise errors.HTTPValidationError(response_data, http_res)
|
|
@@ -524,9 +525,9 @@ class Organizations(BaseSDK):
|
|
|
524
525
|
|
|
525
526
|
response_data: Any = None
|
|
526
527
|
if utils.match_response(http_res, "200", "application/json"):
|
|
527
|
-
return
|
|
528
|
+
return unmarshal_json_response(models.OrganizationResponse, http_res)
|
|
528
529
|
if utils.match_response(http_res, "422", "application/json"):
|
|
529
|
-
response_data =
|
|
530
|
+
response_data = unmarshal_json_response(
|
|
530
531
|
errors.HTTPValidationErrorData, http_res
|
|
531
532
|
)
|
|
532
533
|
raise errors.HTTPValidationError(response_data, http_res)
|
|
@@ -620,9 +621,9 @@ class Organizations(BaseSDK):
|
|
|
620
621
|
|
|
621
622
|
response_data: Any = None
|
|
622
623
|
if utils.match_response(http_res, "200", "application/json"):
|
|
623
|
-
return
|
|
624
|
+
return unmarshal_json_response(Any, http_res)
|
|
624
625
|
if utils.match_response(http_res, "422", "application/json"):
|
|
625
|
-
response_data =
|
|
626
|
+
response_data = unmarshal_json_response(
|
|
626
627
|
errors.HTTPValidationErrorData, http_res
|
|
627
628
|
)
|
|
628
629
|
raise errors.HTTPValidationError(response_data, http_res)
|
|
@@ -716,9 +717,9 @@ class Organizations(BaseSDK):
|
|
|
716
717
|
|
|
717
718
|
response_data: Any = None
|
|
718
719
|
if utils.match_response(http_res, "200", "application/json"):
|
|
719
|
-
return
|
|
720
|
+
return unmarshal_json_response(Any, http_res)
|
|
720
721
|
if utils.match_response(http_res, "422", "application/json"):
|
|
721
|
-
response_data =
|
|
722
|
+
response_data = unmarshal_json_response(
|
|
722
723
|
errors.HTTPValidationErrorData, http_res
|
|
723
724
|
)
|
|
724
725
|
raise errors.HTTPValidationError(response_data, http_res)
|
syllable_sdk/permissions.py
CHANGED
|
@@ -5,6 +5,7 @@ from syllable_sdk import errors, models, utils
|
|
|
5
5
|
from syllable_sdk._hooks import HookContext
|
|
6
6
|
from syllable_sdk.types import OptionalNullable, UNSET
|
|
7
7
|
from syllable_sdk.utils import get_security_from_env
|
|
8
|
+
from syllable_sdk.utils.unmarshal_json_response import unmarshal_json_response
|
|
8
9
|
from typing import List, Mapping, Optional
|
|
9
10
|
|
|
10
11
|
|
|
@@ -77,7 +78,7 @@ class Permissions(BaseSDK):
|
|
|
77
78
|
)
|
|
78
79
|
|
|
79
80
|
if utils.match_response(http_res, "200", "application/json"):
|
|
80
|
-
return
|
|
81
|
+
return unmarshal_json_response(
|
|
81
82
|
List[models.PermissionGroupResponse], http_res
|
|
82
83
|
)
|
|
83
84
|
if utils.match_response(http_res, "4XX", "*"):
|
|
@@ -155,7 +156,7 @@ class Permissions(BaseSDK):
|
|
|
155
156
|
)
|
|
156
157
|
|
|
157
158
|
if utils.match_response(http_res, "200", "application/json"):
|
|
158
|
-
return
|
|
159
|
+
return unmarshal_json_response(
|
|
159
160
|
List[models.PermissionGroupResponse], http_res
|
|
160
161
|
)
|
|
161
162
|
if utils.match_response(http_res, "4XX", "*"):
|
syllable_sdk/prompts.py
CHANGED
|
@@ -5,6 +5,7 @@ from syllable_sdk import errors, models, utils
|
|
|
5
5
|
from syllable_sdk._hooks import HookContext
|
|
6
6
|
from syllable_sdk.types import BaseModel, OptionalNullable, UNSET
|
|
7
7
|
from syllable_sdk.utils import get_security_from_env
|
|
8
|
+
from syllable_sdk.utils.unmarshal_json_response import unmarshal_json_response
|
|
8
9
|
from typing import Any, List, Mapping, Optional, Union, cast
|
|
9
10
|
|
|
10
11
|
|
|
@@ -109,11 +110,9 @@ class Prompts(BaseSDK):
|
|
|
109
110
|
|
|
110
111
|
response_data: Any = None
|
|
111
112
|
if utils.match_response(http_res, "200", "application/json"):
|
|
112
|
-
return
|
|
113
|
-
models.ListResponsePromptResponse, http_res
|
|
114
|
-
)
|
|
113
|
+
return unmarshal_json_response(models.ListResponsePromptResponse, http_res)
|
|
115
114
|
if utils.match_response(http_res, "422", "application/json"):
|
|
116
|
-
response_data =
|
|
115
|
+
response_data = unmarshal_json_response(
|
|
117
116
|
errors.HTTPValidationErrorData, http_res
|
|
118
117
|
)
|
|
119
118
|
raise errors.HTTPValidationError(response_data, http_res)
|
|
@@ -224,11 +223,9 @@ class Prompts(BaseSDK):
|
|
|
224
223
|
|
|
225
224
|
response_data: Any = None
|
|
226
225
|
if utils.match_response(http_res, "200", "application/json"):
|
|
227
|
-
return
|
|
228
|
-
models.ListResponsePromptResponse, http_res
|
|
229
|
-
)
|
|
226
|
+
return unmarshal_json_response(models.ListResponsePromptResponse, http_res)
|
|
230
227
|
if utils.match_response(http_res, "422", "application/json"):
|
|
231
|
-
response_data =
|
|
228
|
+
response_data = unmarshal_json_response(
|
|
232
229
|
errors.HTTPValidationErrorData, http_res
|
|
233
230
|
)
|
|
234
231
|
raise errors.HTTPValidationError(response_data, http_res)
|
|
@@ -318,9 +315,9 @@ class Prompts(BaseSDK):
|
|
|
318
315
|
|
|
319
316
|
response_data: Any = None
|
|
320
317
|
if utils.match_response(http_res, "200", "application/json"):
|
|
321
|
-
return
|
|
318
|
+
return unmarshal_json_response(models.PromptResponse, http_res)
|
|
322
319
|
if utils.match_response(http_res, "422", "application/json"):
|
|
323
|
-
response_data =
|
|
320
|
+
response_data = unmarshal_json_response(
|
|
324
321
|
errors.HTTPValidationErrorData, http_res
|
|
325
322
|
)
|
|
326
323
|
raise errors.HTTPValidationError(response_data, http_res)
|
|
@@ -410,9 +407,9 @@ class Prompts(BaseSDK):
|
|
|
410
407
|
|
|
411
408
|
response_data: Any = None
|
|
412
409
|
if utils.match_response(http_res, "200", "application/json"):
|
|
413
|
-
return
|
|
410
|
+
return unmarshal_json_response(models.PromptResponse, http_res)
|
|
414
411
|
if utils.match_response(http_res, "422", "application/json"):
|
|
415
|
-
response_data =
|
|
412
|
+
response_data = unmarshal_json_response(
|
|
416
413
|
errors.HTTPValidationErrorData, http_res
|
|
417
414
|
)
|
|
418
415
|
raise errors.HTTPValidationError(response_data, http_res)
|
|
@@ -502,9 +499,9 @@ class Prompts(BaseSDK):
|
|
|
502
499
|
|
|
503
500
|
response_data: Any = None
|
|
504
501
|
if utils.match_response(http_res, "200", "application/json"):
|
|
505
|
-
return
|
|
502
|
+
return unmarshal_json_response(models.PromptResponse, http_res)
|
|
506
503
|
if utils.match_response(http_res, "422", "application/json"):
|
|
507
|
-
response_data =
|
|
504
|
+
response_data = unmarshal_json_response(
|
|
508
505
|
errors.HTTPValidationErrorData, http_res
|
|
509
506
|
)
|
|
510
507
|
raise errors.HTTPValidationError(response_data, http_res)
|
|
@@ -594,9 +591,9 @@ class Prompts(BaseSDK):
|
|
|
594
591
|
|
|
595
592
|
response_data: Any = None
|
|
596
593
|
if utils.match_response(http_res, "200", "application/json"):
|
|
597
|
-
return
|
|
594
|
+
return unmarshal_json_response(models.PromptResponse, http_res)
|
|
598
595
|
if utils.match_response(http_res, "422", "application/json"):
|
|
599
|
-
response_data =
|
|
596
|
+
response_data = unmarshal_json_response(
|
|
600
597
|
errors.HTTPValidationErrorData, http_res
|
|
601
598
|
)
|
|
602
599
|
raise errors.HTTPValidationError(response_data, http_res)
|
|
@@ -683,9 +680,9 @@ class Prompts(BaseSDK):
|
|
|
683
680
|
|
|
684
681
|
response_data: Any = None
|
|
685
682
|
if utils.match_response(http_res, "200", "application/json"):
|
|
686
|
-
return
|
|
683
|
+
return unmarshal_json_response(models.PromptResponse, http_res)
|
|
687
684
|
if utils.match_response(http_res, "422", "application/json"):
|
|
688
|
-
response_data =
|
|
685
|
+
response_data = unmarshal_json_response(
|
|
689
686
|
errors.HTTPValidationErrorData, http_res
|
|
690
687
|
)
|
|
691
688
|
raise errors.HTTPValidationError(response_data, http_res)
|
|
@@ -772,9 +769,9 @@ class Prompts(BaseSDK):
|
|
|
772
769
|
|
|
773
770
|
response_data: Any = None
|
|
774
771
|
if utils.match_response(http_res, "200", "application/json"):
|
|
775
|
-
return
|
|
772
|
+
return unmarshal_json_response(models.PromptResponse, http_res)
|
|
776
773
|
if utils.match_response(http_res, "422", "application/json"):
|
|
777
|
-
response_data =
|
|
774
|
+
response_data = unmarshal_json_response(
|
|
778
775
|
errors.HTTPValidationErrorData, http_res
|
|
779
776
|
)
|
|
780
777
|
raise errors.HTTPValidationError(response_data, http_res)
|
|
@@ -864,9 +861,9 @@ class Prompts(BaseSDK):
|
|
|
864
861
|
|
|
865
862
|
response_data: Any = None
|
|
866
863
|
if utils.match_response(http_res, "200", "application/json"):
|
|
867
|
-
return
|
|
864
|
+
return unmarshal_json_response(Any, http_res)
|
|
868
865
|
if utils.match_response(http_res, "422", "application/json"):
|
|
869
|
-
response_data =
|
|
866
|
+
response_data = unmarshal_json_response(
|
|
870
867
|
errors.HTTPValidationErrorData, http_res
|
|
871
868
|
)
|
|
872
869
|
raise errors.HTTPValidationError(response_data, http_res)
|
|
@@ -956,9 +953,9 @@ class Prompts(BaseSDK):
|
|
|
956
953
|
|
|
957
954
|
response_data: Any = None
|
|
958
955
|
if utils.match_response(http_res, "200", "application/json"):
|
|
959
|
-
return
|
|
956
|
+
return unmarshal_json_response(Any, http_res)
|
|
960
957
|
if utils.match_response(http_res, "422", "application/json"):
|
|
961
|
-
response_data =
|
|
958
|
+
response_data = unmarshal_json_response(
|
|
962
959
|
errors.HTTPValidationErrorData, http_res
|
|
963
960
|
)
|
|
964
961
|
raise errors.HTTPValidationError(response_data, http_res)
|
|
@@ -1045,9 +1042,9 @@ class Prompts(BaseSDK):
|
|
|
1045
1042
|
|
|
1046
1043
|
response_data: Any = None
|
|
1047
1044
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1048
|
-
return
|
|
1045
|
+
return unmarshal_json_response(List[models.PromptHistory], http_res)
|
|
1049
1046
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1050
|
-
response_data =
|
|
1047
|
+
response_data = unmarshal_json_response(
|
|
1051
1048
|
errors.HTTPValidationErrorData, http_res
|
|
1052
1049
|
)
|
|
1053
1050
|
raise errors.HTTPValidationError(response_data, http_res)
|
|
@@ -1134,9 +1131,9 @@ class Prompts(BaseSDK):
|
|
|
1134
1131
|
|
|
1135
1132
|
response_data: Any = None
|
|
1136
1133
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1137
|
-
return
|
|
1134
|
+
return unmarshal_json_response(List[models.PromptHistory], http_res)
|
|
1138
1135
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1139
|
-
response_data =
|
|
1136
|
+
response_data = unmarshal_json_response(
|
|
1140
1137
|
errors.HTTPValidationErrorData, http_res
|
|
1141
1138
|
)
|
|
1142
1139
|
raise errors.HTTPValidationError(response_data, http_res)
|
|
@@ -1215,7 +1212,7 @@ class Prompts(BaseSDK):
|
|
|
1215
1212
|
)
|
|
1216
1213
|
|
|
1217
1214
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1218
|
-
return
|
|
1215
|
+
return unmarshal_json_response(List[models.SupportedLlm], http_res)
|
|
1219
1216
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1220
1217
|
http_res_text = utils.stream_to_text(http_res)
|
|
1221
1218
|
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
@@ -1291,7 +1288,7 @@ class Prompts(BaseSDK):
|
|
|
1291
1288
|
)
|
|
1292
1289
|
|
|
1293
1290
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1294
|
-
return
|
|
1291
|
+
return unmarshal_json_response(List[models.SupportedLlm], http_res)
|
|
1295
1292
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1296
1293
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1297
1294
|
raise errors.APIError("API error occurred", http_res, http_res_text)
|
syllable_sdk/roles.py
CHANGED
|
@@ -5,6 +5,7 @@ from syllable_sdk import errors, models, utils
|
|
|
5
5
|
from syllable_sdk._hooks import HookContext
|
|
6
6
|
from syllable_sdk.types import BaseModel, OptionalNullable, UNSET
|
|
7
7
|
from syllable_sdk.utils import get_security_from_env
|
|
8
|
+
from syllable_sdk.utils.unmarshal_json_response import unmarshal_json_response
|
|
8
9
|
from typing import Any, List, Mapping, Optional, Union, cast
|
|
9
10
|
|
|
10
11
|
|
|
@@ -109,11 +110,9 @@ class Roles(BaseSDK):
|
|
|
109
110
|
|
|
110
111
|
response_data: Any = None
|
|
111
112
|
if utils.match_response(http_res, "200", "application/json"):
|
|
112
|
-
return
|
|
113
|
-
models.ListResponseRoleResponse, http_res
|
|
114
|
-
)
|
|
113
|
+
return unmarshal_json_response(models.ListResponseRoleResponse, http_res)
|
|
115
114
|
if utils.match_response(http_res, "422", "application/json"):
|
|
116
|
-
response_data =
|
|
115
|
+
response_data = unmarshal_json_response(
|
|
117
116
|
errors.HTTPValidationErrorData, http_res
|
|
118
117
|
)
|
|
119
118
|
raise errors.HTTPValidationError(response_data, http_res)
|
|
@@ -224,11 +223,9 @@ class Roles(BaseSDK):
|
|
|
224
223
|
|
|
225
224
|
response_data: Any = None
|
|
226
225
|
if utils.match_response(http_res, "200", "application/json"):
|
|
227
|
-
return
|
|
228
|
-
models.ListResponseRoleResponse, http_res
|
|
229
|
-
)
|
|
226
|
+
return unmarshal_json_response(models.ListResponseRoleResponse, http_res)
|
|
230
227
|
if utils.match_response(http_res, "422", "application/json"):
|
|
231
|
-
response_data =
|
|
228
|
+
response_data = unmarshal_json_response(
|
|
232
229
|
errors.HTTPValidationErrorData, http_res
|
|
233
230
|
)
|
|
234
231
|
raise errors.HTTPValidationError(response_data, http_res)
|
|
@@ -318,9 +315,9 @@ class Roles(BaseSDK):
|
|
|
318
315
|
|
|
319
316
|
response_data: Any = None
|
|
320
317
|
if utils.match_response(http_res, "200", "application/json"):
|
|
321
|
-
return
|
|
318
|
+
return unmarshal_json_response(models.RoleResponse, http_res)
|
|
322
319
|
if utils.match_response(http_res, "422", "application/json"):
|
|
323
|
-
response_data =
|
|
320
|
+
response_data = unmarshal_json_response(
|
|
324
321
|
errors.HTTPValidationErrorData, http_res
|
|
325
322
|
)
|
|
326
323
|
raise errors.HTTPValidationError(response_data, http_res)
|
|
@@ -410,9 +407,9 @@ class Roles(BaseSDK):
|
|
|
410
407
|
|
|
411
408
|
response_data: Any = None
|
|
412
409
|
if utils.match_response(http_res, "200", "application/json"):
|
|
413
|
-
return
|
|
410
|
+
return unmarshal_json_response(models.RoleResponse, http_res)
|
|
414
411
|
if utils.match_response(http_res, "422", "application/json"):
|
|
415
|
-
response_data =
|
|
412
|
+
response_data = unmarshal_json_response(
|
|
416
413
|
errors.HTTPValidationErrorData, http_res
|
|
417
414
|
)
|
|
418
415
|
raise errors.HTTPValidationError(response_data, http_res)
|
|
@@ -502,9 +499,9 @@ class Roles(BaseSDK):
|
|
|
502
499
|
|
|
503
500
|
response_data: Any = None
|
|
504
501
|
if utils.match_response(http_res, "200", "application/json"):
|
|
505
|
-
return
|
|
502
|
+
return unmarshal_json_response(models.RoleResponse, http_res)
|
|
506
503
|
if utils.match_response(http_res, "422", "application/json"):
|
|
507
|
-
response_data =
|
|
504
|
+
response_data = unmarshal_json_response(
|
|
508
505
|
errors.HTTPValidationErrorData, http_res
|
|
509
506
|
)
|
|
510
507
|
raise errors.HTTPValidationError(response_data, http_res)
|
|
@@ -594,9 +591,9 @@ class Roles(BaseSDK):
|
|
|
594
591
|
|
|
595
592
|
response_data: Any = None
|
|
596
593
|
if utils.match_response(http_res, "200", "application/json"):
|
|
597
|
-
return
|
|
594
|
+
return unmarshal_json_response(models.RoleResponse, http_res)
|
|
598
595
|
if utils.match_response(http_res, "422", "application/json"):
|
|
599
|
-
response_data =
|
|
596
|
+
response_data = unmarshal_json_response(
|
|
600
597
|
errors.HTTPValidationErrorData, http_res
|
|
601
598
|
)
|
|
602
599
|
raise errors.HTTPValidationError(response_data, http_res)
|
|
@@ -683,9 +680,9 @@ class Roles(BaseSDK):
|
|
|
683
680
|
|
|
684
681
|
response_data: Any = None
|
|
685
682
|
if utils.match_response(http_res, "200", "application/json"):
|
|
686
|
-
return
|
|
683
|
+
return unmarshal_json_response(models.RoleResponse, http_res)
|
|
687
684
|
if utils.match_response(http_res, "422", "application/json"):
|
|
688
|
-
response_data =
|
|
685
|
+
response_data = unmarshal_json_response(
|
|
689
686
|
errors.HTTPValidationErrorData, http_res
|
|
690
687
|
)
|
|
691
688
|
raise errors.HTTPValidationError(response_data, http_res)
|
|
@@ -772,9 +769,9 @@ class Roles(BaseSDK):
|
|
|
772
769
|
|
|
773
770
|
response_data: Any = None
|
|
774
771
|
if utils.match_response(http_res, "200", "application/json"):
|
|
775
|
-
return
|
|
772
|
+
return unmarshal_json_response(models.RoleResponse, http_res)
|
|
776
773
|
if utils.match_response(http_res, "422", "application/json"):
|
|
777
|
-
response_data =
|
|
774
|
+
response_data = unmarshal_json_response(
|
|
778
775
|
errors.HTTPValidationErrorData, http_res
|
|
779
776
|
)
|
|
780
777
|
raise errors.HTTPValidationError(response_data, http_res)
|
|
@@ -867,9 +864,9 @@ class Roles(BaseSDK):
|
|
|
867
864
|
|
|
868
865
|
response_data: Any = None
|
|
869
866
|
if utils.match_response(http_res, "200", "application/json"):
|
|
870
|
-
return
|
|
867
|
+
return unmarshal_json_response(Any, http_res)
|
|
871
868
|
if utils.match_response(http_res, "422", "application/json"):
|
|
872
|
-
response_data =
|
|
869
|
+
response_data = unmarshal_json_response(
|
|
873
870
|
errors.HTTPValidationErrorData, http_res
|
|
874
871
|
)
|
|
875
872
|
raise errors.HTTPValidationError(response_data, http_res)
|
|
@@ -962,9 +959,9 @@ class Roles(BaseSDK):
|
|
|
962
959
|
|
|
963
960
|
response_data: Any = None
|
|
964
961
|
if utils.match_response(http_res, "200", "application/json"):
|
|
965
|
-
return
|
|
962
|
+
return unmarshal_json_response(Any, http_res)
|
|
966
963
|
if utils.match_response(http_res, "422", "application/json"):
|
|
967
|
-
response_data =
|
|
964
|
+
response_data = unmarshal_json_response(
|
|
968
965
|
errors.HTTPValidationErrorData, http_res
|
|
969
966
|
)
|
|
970
967
|
raise errors.HTTPValidationError(response_data, http_res)
|