syllable-sdk 0.35.79__py3-none-any.whl → 0.36.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.
- syllable_sdk/_version.py +3 -3
- syllable_sdk/agents.py +5 -3
- syllable_sdk/basesdk.py +11 -1
- syllable_sdk/channels.py +6 -4
- syllable_sdk/errors/__init__.py +15 -3
- syllable_sdk/insights_sdk.py +7 -5
- syllable_sdk/models/__init__.py +14 -1
- syllable_sdk/models/agentsttprovider.py +2 -0
- syllable_sdk/models/servicecreaterequest.py +2 -2
- syllable_sdk/models/serviceupdaterequest.py +2 -2
- syllable_sdk/outbound.py +7 -4
- syllable_sdk/sdk.py +15 -2
- syllable_sdk/sessions.py +9 -5
- syllable_sdk/twilio.py +5 -3
- syllable_sdk/utils/__init__.py +15 -3
- syllable_sdk/utils/eventstreaming.py +10 -0
- {syllable_sdk-0.35.79.dist-info → syllable_sdk-0.36.1.dist-info}/METADATA +1 -1
- {syllable_sdk-0.35.79.dist-info → syllable_sdk-0.36.1.dist-info}/RECORD +19 -19
- {syllable_sdk-0.35.79.dist-info → syllable_sdk-0.36.1.dist-info}/WHEEL +0 -0
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.
|
|
6
|
+
__version__: str = "0.36.1"
|
|
7
7
|
__openapi_doc_version__: str = "0.0.2"
|
|
8
|
-
__gen_version__: str = "2.
|
|
9
|
-
__user_agent__: str = "speakeasy-sdk/python 0.
|
|
8
|
+
__gen_version__: str = "2.687.13"
|
|
9
|
+
__user_agent__: str = "speakeasy-sdk/python 0.36.1 2.687.13 0.0.2 syllable-sdk"
|
|
10
10
|
|
|
11
11
|
try:
|
|
12
12
|
if __package__ is not None:
|
syllable_sdk/agents.py
CHANGED
|
@@ -17,13 +17,15 @@ class Agents(BaseSDK):
|
|
|
17
17
|
test: Test
|
|
18
18
|
r"""Operations for testing agents with live text. These endpoints allow sending messages to an agent and receiving its responses."""
|
|
19
19
|
|
|
20
|
-
def __init__(
|
|
21
|
-
|
|
20
|
+
def __init__(
|
|
21
|
+
self, sdk_config: SDKConfiguration, parent_ref: Optional[object] = None
|
|
22
|
+
) -> None:
|
|
23
|
+
BaseSDK.__init__(self, sdk_config, parent_ref=parent_ref)
|
|
22
24
|
self.sdk_configuration = sdk_config
|
|
23
25
|
self._init_sdks()
|
|
24
26
|
|
|
25
27
|
def _init_sdks(self):
|
|
26
|
-
self.test = Test(self.sdk_configuration)
|
|
28
|
+
self.test = Test(self.sdk_configuration, parent_ref=self.parent_ref)
|
|
27
29
|
|
|
28
30
|
def list(
|
|
29
31
|
self,
|
syllable_sdk/basesdk.py
CHANGED
|
@@ -15,9 +15,19 @@ from urllib.parse import parse_qs, urlparse
|
|
|
15
15
|
|
|
16
16
|
class BaseSDK:
|
|
17
17
|
sdk_configuration: SDKConfiguration
|
|
18
|
+
parent_ref: Optional[object] = None
|
|
19
|
+
"""
|
|
20
|
+
Reference to the root SDK instance, if any. This will prevent it from
|
|
21
|
+
being garbage collected while there are active streams.
|
|
22
|
+
"""
|
|
18
23
|
|
|
19
|
-
def __init__(
|
|
24
|
+
def __init__(
|
|
25
|
+
self,
|
|
26
|
+
sdk_config: SDKConfiguration,
|
|
27
|
+
parent_ref: Optional[object] = None,
|
|
28
|
+
) -> None:
|
|
20
29
|
self.sdk_configuration = sdk_config
|
|
30
|
+
self.parent_ref = parent_ref
|
|
21
31
|
|
|
22
32
|
def _get_url(self, base_url, url_variables):
|
|
23
33
|
sdk_url, sdk_variables = self.sdk_configuration.get_server_details()
|
syllable_sdk/channels.py
CHANGED
|
@@ -20,14 +20,16 @@ class Channels(BaseSDK):
|
|
|
20
20
|
targets: Targets
|
|
21
21
|
r"""Operations related to channel target configuration. A channel target links a channel to an agent, allowing users to communicate with the agent through that channel. For more information, see [Console docs](https://docs.syllable.ai/Resources/Channels)."""
|
|
22
22
|
|
|
23
|
-
def __init__(
|
|
24
|
-
|
|
23
|
+
def __init__(
|
|
24
|
+
self, sdk_config: SDKConfiguration, parent_ref: Optional[object] = None
|
|
25
|
+
) -> None:
|
|
26
|
+
BaseSDK.__init__(self, sdk_config, parent_ref=parent_ref)
|
|
25
27
|
self.sdk_configuration = sdk_config
|
|
26
28
|
self._init_sdks()
|
|
27
29
|
|
|
28
30
|
def _init_sdks(self):
|
|
29
|
-
self.twilio = Twilio(self.sdk_configuration)
|
|
30
|
-
self.targets = Targets(self.sdk_configuration)
|
|
31
|
+
self.twilio = Twilio(self.sdk_configuration, parent_ref=self.parent_ref)
|
|
32
|
+
self.targets = Targets(self.sdk_configuration, parent_ref=self.parent_ref)
|
|
31
33
|
|
|
32
34
|
def list(
|
|
33
35
|
self,
|
syllable_sdk/errors/__init__.py
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
|
+
from .syllablesdkerror import SyllableSDKError
|
|
3
4
|
from typing import TYPE_CHECKING
|
|
4
5
|
from importlib import import_module
|
|
5
6
|
import builtins
|
|
7
|
+
import sys
|
|
6
8
|
|
|
7
9
|
if TYPE_CHECKING:
|
|
8
10
|
from .apierror import APIError
|
|
9
11
|
from .httpvalidationerror import HTTPValidationError, HTTPValidationErrorData
|
|
10
12
|
from .no_response_error import NoResponseError
|
|
11
13
|
from .responsevalidationerror import ResponseValidationError
|
|
12
|
-
from .syllablesdkerror import SyllableSDKError
|
|
13
14
|
|
|
14
15
|
__all__ = [
|
|
15
16
|
"APIError",
|
|
@@ -26,10 +27,21 @@ _dynamic_imports: dict[str, str] = {
|
|
|
26
27
|
"HTTPValidationErrorData": ".httpvalidationerror",
|
|
27
28
|
"NoResponseError": ".no_response_error",
|
|
28
29
|
"ResponseValidationError": ".responsevalidationerror",
|
|
29
|
-
"SyllableSDKError": ".syllablesdkerror",
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
|
|
33
|
+
def dynamic_import(modname, retries=3):
|
|
34
|
+
for attempt in range(retries):
|
|
35
|
+
try:
|
|
36
|
+
return import_module(modname, __package__)
|
|
37
|
+
except KeyError:
|
|
38
|
+
# Clear any half-initialized module and retry
|
|
39
|
+
sys.modules.pop(modname, None)
|
|
40
|
+
if attempt == retries - 1:
|
|
41
|
+
break
|
|
42
|
+
raise KeyError(f"Failed to import module '{modname}' after {retries} attempts")
|
|
43
|
+
|
|
44
|
+
|
|
33
45
|
def __getattr__(attr_name: str) -> object:
|
|
34
46
|
module_name = _dynamic_imports.get(attr_name)
|
|
35
47
|
if module_name is None:
|
|
@@ -38,7 +50,7 @@ def __getattr__(attr_name: str) -> object:
|
|
|
38
50
|
)
|
|
39
51
|
|
|
40
52
|
try:
|
|
41
|
-
module =
|
|
53
|
+
module = dynamic_import(module_name)
|
|
42
54
|
result = getattr(module, attr_name)
|
|
43
55
|
return result
|
|
44
56
|
except ImportError as e:
|
syllable_sdk/insights_sdk.py
CHANGED
|
@@ -23,15 +23,17 @@ class InsightsSDK(BaseSDK):
|
|
|
23
23
|
tools: InsightsTools
|
|
24
24
|
r"""Operations related to insights tool configurationss. An insight is a tool that processes conversation data to extract information and generate reports."""
|
|
25
25
|
|
|
26
|
-
def __init__(
|
|
27
|
-
|
|
26
|
+
def __init__(
|
|
27
|
+
self, sdk_config: SDKConfiguration, parent_ref: Optional[object] = None
|
|
28
|
+
) -> None:
|
|
29
|
+
BaseSDK.__init__(self, sdk_config, parent_ref=parent_ref)
|
|
28
30
|
self.sdk_configuration = sdk_config
|
|
29
31
|
self._init_sdks()
|
|
30
32
|
|
|
31
33
|
def _init_sdks(self):
|
|
32
|
-
self.folders = Folders(self.sdk_configuration)
|
|
33
|
-
self.workflows = Workflows(self.sdk_configuration)
|
|
34
|
-
self.tools = InsightsTools(self.sdk_configuration)
|
|
34
|
+
self.folders = Folders(self.sdk_configuration, parent_ref=self.parent_ref)
|
|
35
|
+
self.workflows = Workflows(self.sdk_configuration, parent_ref=self.parent_ref)
|
|
36
|
+
self.tools = InsightsTools(self.sdk_configuration, parent_ref=self.parent_ref)
|
|
35
37
|
|
|
36
38
|
def list(
|
|
37
39
|
self,
|
syllable_sdk/models/__init__.py
CHANGED
|
@@ -5,6 +5,7 @@ from .channeltargetresponse import ChannelTargetResponse, ChannelTargetResponseT
|
|
|
5
5
|
from typing import TYPE_CHECKING
|
|
6
6
|
from importlib import import_module
|
|
7
7
|
import builtins
|
|
8
|
+
import sys
|
|
8
9
|
|
|
9
10
|
if TYPE_CHECKING:
|
|
10
11
|
from .agent_deleteop import AgentDeleteRequest, AgentDeleteRequestTypedDict
|
|
@@ -1993,6 +1994,18 @@ _dynamic_imports: dict[str, str] = {
|
|
|
1993
1994
|
}
|
|
1994
1995
|
|
|
1995
1996
|
|
|
1997
|
+
def dynamic_import(modname, retries=3):
|
|
1998
|
+
for attempt in range(retries):
|
|
1999
|
+
try:
|
|
2000
|
+
return import_module(modname, __package__)
|
|
2001
|
+
except KeyError:
|
|
2002
|
+
# Clear any half-initialized module and retry
|
|
2003
|
+
sys.modules.pop(modname, None)
|
|
2004
|
+
if attempt == retries - 1:
|
|
2005
|
+
break
|
|
2006
|
+
raise KeyError(f"Failed to import module '{modname}' after {retries} attempts")
|
|
2007
|
+
|
|
2008
|
+
|
|
1996
2009
|
def __getattr__(attr_name: str) -> object:
|
|
1997
2010
|
module_name = _dynamic_imports.get(attr_name)
|
|
1998
2011
|
if module_name is None:
|
|
@@ -2001,7 +2014,7 @@ def __getattr__(attr_name: str) -> object:
|
|
|
2001
2014
|
)
|
|
2002
2015
|
|
|
2003
2016
|
try:
|
|
2004
|
-
module =
|
|
2017
|
+
module = dynamic_import(module_name)
|
|
2005
2018
|
result = getattr(module, attr_name)
|
|
2006
2019
|
return result
|
|
2007
2020
|
except ImportError as e:
|
|
@@ -7,6 +7,8 @@ from enum import Enum
|
|
|
7
7
|
class AgentSttProvider(str, Enum):
|
|
8
8
|
r"""Speech-to-text providers supported by agents."""
|
|
9
9
|
|
|
10
|
+
GOOGLE_STT_V2_CHIRP_2_ = "Google STT V2 (Chirp 2)"
|
|
11
|
+
DEEPGRAM_NOVA_3 = "Deepgram Nova 3"
|
|
10
12
|
GOOGLE_STT_V2 = "Google STT V2"
|
|
11
13
|
GOOGLE_STT_V1 = "Google STT V1"
|
|
12
14
|
DEEPGRAM_NOVA_2 = "Deepgram Nova 2"
|
|
@@ -24,7 +24,7 @@ class ServiceCreateRequestTypedDict(TypedDict):
|
|
|
24
24
|
auth_type: NotRequired[Nullable[ToolAuthType]]
|
|
25
25
|
r"""The type of authentication to use for the service's tools"""
|
|
26
26
|
auth_values: NotRequired[Nullable[Any]]
|
|
27
|
-
r"""The values to use for the authentication, as a dict. Should contain \"username\" and \"password\" keys if auth type is basic, \"token\" key if auth type is bearer,
|
|
27
|
+
r"""The values to use for the authentication, as a dict. Should contain \"username\" and \"password\" keys if auth type is basic, \"token\" key if auth type is bearer, arbitrary header keys if auth type is custom_headers. or \"client_id\", \"client_secret\", and \"auth_url\" keys if auth type is oauth2. On an update, leave a value for a given key null and the value in the database will not be updated. (If a key is omitted entirely, any existing value for that key will be removed.)"""
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
class ServiceCreateRequest(BaseModel):
|
|
@@ -40,7 +40,7 @@ class ServiceCreateRequest(BaseModel):
|
|
|
40
40
|
r"""The type of authentication to use for the service's tools"""
|
|
41
41
|
|
|
42
42
|
auth_values: OptionalNullable[Any] = UNSET
|
|
43
|
-
r"""The values to use for the authentication, as a dict. Should contain \"username\" and \"password\" keys if auth type is basic, \"token\" key if auth type is bearer,
|
|
43
|
+
r"""The values to use for the authentication, as a dict. Should contain \"username\" and \"password\" keys if auth type is basic, \"token\" key if auth type is bearer, arbitrary header keys if auth type is custom_headers. or \"client_id\", \"client_secret\", and \"auth_url\" keys if auth type is oauth2. On an update, leave a value for a given key null and the value in the database will not be updated. (If a key is omitted entirely, any existing value for that key will be removed.)"""
|
|
44
44
|
|
|
45
45
|
@model_serializer(mode="wrap")
|
|
46
46
|
def serialize_model(self, handler):
|
|
@@ -26,7 +26,7 @@ class ServiceUpdateRequestTypedDict(TypedDict):
|
|
|
26
26
|
auth_type: NotRequired[Nullable[ToolAuthType]]
|
|
27
27
|
r"""The type of authentication to use for the service's tools"""
|
|
28
28
|
auth_values: NotRequired[Nullable[Any]]
|
|
29
|
-
r"""The values to use for the authentication, as a dict. Should contain \"username\" and \"password\" keys if auth type is basic, \"token\" key if auth type is bearer,
|
|
29
|
+
r"""The values to use for the authentication, as a dict. Should contain \"username\" and \"password\" keys if auth type is basic, \"token\" key if auth type is bearer, arbitrary header keys if auth type is custom_headers. or \"client_id\", \"client_secret\", and \"auth_url\" keys if auth type is oauth2. On an update, leave a value for a given key null and the value in the database will not be updated. (If a key is omitted entirely, any existing value for that key will be removed.)"""
|
|
30
30
|
last_updated_comments: NotRequired[Nullable[str]]
|
|
31
31
|
r"""Free text providing comment about what was updated"""
|
|
32
32
|
|
|
@@ -47,7 +47,7 @@ class ServiceUpdateRequest(BaseModel):
|
|
|
47
47
|
r"""The type of authentication to use for the service's tools"""
|
|
48
48
|
|
|
49
49
|
auth_values: OptionalNullable[Any] = UNSET
|
|
50
|
-
r"""The values to use for the authentication, as a dict. Should contain \"username\" and \"password\" keys if auth type is basic, \"token\" key if auth type is bearer,
|
|
50
|
+
r"""The values to use for the authentication, as a dict. Should contain \"username\" and \"password\" keys if auth type is basic, \"token\" key if auth type is bearer, arbitrary header keys if auth type is custom_headers. or \"client_id\", \"client_secret\", and \"auth_url\" keys if auth type is oauth2. On an update, leave a value for a given key null and the value in the database will not be updated. (If a key is omitted entirely, any existing value for that key will be removed.)"""
|
|
51
51
|
|
|
52
52
|
last_updated_comments: OptionalNullable[str] = UNSET
|
|
53
53
|
r"""Free text providing comment about what was updated"""
|
syllable_sdk/outbound.py
CHANGED
|
@@ -4,6 +4,7 @@ from .basesdk import BaseSDK
|
|
|
4
4
|
from .sdkconfiguration import SDKConfiguration
|
|
5
5
|
from syllable_sdk.batches import Batches
|
|
6
6
|
from syllable_sdk.campaigns import Campaigns
|
|
7
|
+
from typing import Optional
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
class Outbound(BaseSDK):
|
|
@@ -12,11 +13,13 @@ class Outbound(BaseSDK):
|
|
|
12
13
|
campaigns: Campaigns
|
|
13
14
|
r"""Operations related to outbound message campaigns"""
|
|
14
15
|
|
|
15
|
-
def __init__(
|
|
16
|
-
|
|
16
|
+
def __init__(
|
|
17
|
+
self, sdk_config: SDKConfiguration, parent_ref: Optional[object] = None
|
|
18
|
+
) -> None:
|
|
19
|
+
BaseSDK.__init__(self, sdk_config, parent_ref=parent_ref)
|
|
17
20
|
self.sdk_configuration = sdk_config
|
|
18
21
|
self._init_sdks()
|
|
19
22
|
|
|
20
23
|
def _init_sdks(self):
|
|
21
|
-
self.batches = Batches(self.sdk_configuration)
|
|
22
|
-
self.campaigns = Campaigns(self.sdk_configuration)
|
|
24
|
+
self.batches = Batches(self.sdk_configuration, parent_ref=self.parent_ref)
|
|
25
|
+
self.campaigns = Campaigns(self.sdk_configuration, parent_ref=self.parent_ref)
|
syllable_sdk/sdk.py
CHANGED
|
@@ -10,6 +10,7 @@ import importlib
|
|
|
10
10
|
from syllable_sdk import models, utils
|
|
11
11
|
from syllable_sdk._hooks import SDKHooks
|
|
12
12
|
from syllable_sdk.types import OptionalNullable, UNSET
|
|
13
|
+
import sys
|
|
13
14
|
from typing import Any, Callable, Dict, Optional, TYPE_CHECKING, Union, cast
|
|
14
15
|
import weakref
|
|
15
16
|
|
|
@@ -215,6 +216,7 @@ class SyllableSDK(BaseSDK):
|
|
|
215
216
|
timeout_ms=timeout_ms,
|
|
216
217
|
debug_logger=debug_logger,
|
|
217
218
|
),
|
|
219
|
+
parent_ref=self,
|
|
218
220
|
)
|
|
219
221
|
|
|
220
222
|
hooks = SDKHooks()
|
|
@@ -239,13 +241,24 @@ class SyllableSDK(BaseSDK):
|
|
|
239
241
|
self.sdk_configuration.async_client_supplied,
|
|
240
242
|
)
|
|
241
243
|
|
|
244
|
+
def dynamic_import(self, modname, retries=3):
|
|
245
|
+
for attempt in range(retries):
|
|
246
|
+
try:
|
|
247
|
+
return importlib.import_module(modname)
|
|
248
|
+
except KeyError:
|
|
249
|
+
# Clear any half-initialized module and retry
|
|
250
|
+
sys.modules.pop(modname, None)
|
|
251
|
+
if attempt == retries - 1:
|
|
252
|
+
break
|
|
253
|
+
raise KeyError(f"Failed to import module '{modname}' after {retries} attempts")
|
|
254
|
+
|
|
242
255
|
def __getattr__(self, name: str):
|
|
243
256
|
if name in self._sub_sdk_map:
|
|
244
257
|
module_path, class_name = self._sub_sdk_map[name]
|
|
245
258
|
try:
|
|
246
|
-
module =
|
|
259
|
+
module = self.dynamic_import(module_path)
|
|
247
260
|
klass = getattr(module, class_name)
|
|
248
|
-
instance = klass(self.sdk_configuration)
|
|
261
|
+
instance = klass(self.sdk_configuration, parent_ref=self)
|
|
249
262
|
setattr(self, name, instance)
|
|
250
263
|
return instance
|
|
251
264
|
except ImportError as e:
|
syllable_sdk/sessions.py
CHANGED
|
@@ -21,15 +21,19 @@ class Sessions(BaseSDK):
|
|
|
21
21
|
full_summary: FullSummary
|
|
22
22
|
latency: Latency
|
|
23
23
|
|
|
24
|
-
def __init__(
|
|
25
|
-
|
|
24
|
+
def __init__(
|
|
25
|
+
self, sdk_config: SDKConfiguration, parent_ref: Optional[object] = None
|
|
26
|
+
) -> None:
|
|
27
|
+
BaseSDK.__init__(self, sdk_config, parent_ref=parent_ref)
|
|
26
28
|
self.sdk_configuration = sdk_config
|
|
27
29
|
self._init_sdks()
|
|
28
30
|
|
|
29
31
|
def _init_sdks(self):
|
|
30
|
-
self.transcript = Transcript(self.sdk_configuration)
|
|
31
|
-
self.full_summary = FullSummary(
|
|
32
|
-
|
|
32
|
+
self.transcript = Transcript(self.sdk_configuration, parent_ref=self.parent_ref)
|
|
33
|
+
self.full_summary = FullSummary(
|
|
34
|
+
self.sdk_configuration, parent_ref=self.parent_ref
|
|
35
|
+
)
|
|
36
|
+
self.latency = Latency(self.sdk_configuration, parent_ref=self.parent_ref)
|
|
33
37
|
|
|
34
38
|
def list(
|
|
35
39
|
self,
|
syllable_sdk/twilio.py
CHANGED
|
@@ -17,13 +17,15 @@ class Twilio(BaseSDK):
|
|
|
17
17
|
numbers: Numbers
|
|
18
18
|
r"""Operations related to setting up phone numbers in Twilio for use in channels."""
|
|
19
19
|
|
|
20
|
-
def __init__(
|
|
21
|
-
|
|
20
|
+
def __init__(
|
|
21
|
+
self, sdk_config: SDKConfiguration, parent_ref: Optional[object] = None
|
|
22
|
+
) -> None:
|
|
23
|
+
BaseSDK.__init__(self, sdk_config, parent_ref=parent_ref)
|
|
22
24
|
self.sdk_configuration = sdk_config
|
|
23
25
|
self._init_sdks()
|
|
24
26
|
|
|
25
27
|
def _init_sdks(self):
|
|
26
|
-
self.numbers = Numbers(self.sdk_configuration)
|
|
28
|
+
self.numbers = Numbers(self.sdk_configuration, parent_ref=self.parent_ref)
|
|
27
29
|
|
|
28
30
|
def get_by_id(
|
|
29
31
|
self,
|
syllable_sdk/utils/__init__.py
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
from typing import TYPE_CHECKING
|
|
4
4
|
from importlib import import_module
|
|
5
5
|
import builtins
|
|
6
|
+
import sys
|
|
6
7
|
|
|
7
8
|
if TYPE_CHECKING:
|
|
8
9
|
from .annotations import get_discriminator
|
|
@@ -162,6 +163,18 @@ _dynamic_imports: dict[str, str] = {
|
|
|
162
163
|
}
|
|
163
164
|
|
|
164
165
|
|
|
166
|
+
def dynamic_import(modname, retries=3):
|
|
167
|
+
for attempt in range(retries):
|
|
168
|
+
try:
|
|
169
|
+
return import_module(modname, __package__)
|
|
170
|
+
except KeyError:
|
|
171
|
+
# Clear any half-initialized module and retry
|
|
172
|
+
sys.modules.pop(modname, None)
|
|
173
|
+
if attempt == retries - 1:
|
|
174
|
+
break
|
|
175
|
+
raise KeyError(f"Failed to import module '{modname}' after {retries} attempts")
|
|
176
|
+
|
|
177
|
+
|
|
165
178
|
def __getattr__(attr_name: str) -> object:
|
|
166
179
|
module_name = _dynamic_imports.get(attr_name)
|
|
167
180
|
if module_name is None:
|
|
@@ -170,9 +183,8 @@ def __getattr__(attr_name: str) -> object:
|
|
|
170
183
|
)
|
|
171
184
|
|
|
172
185
|
try:
|
|
173
|
-
module =
|
|
174
|
-
|
|
175
|
-
return result
|
|
186
|
+
module = dynamic_import(module_name)
|
|
187
|
+
return getattr(module, attr_name)
|
|
176
188
|
except ImportError as e:
|
|
177
189
|
raise ImportError(
|
|
178
190
|
f"Failed to import {attr_name} from {module_name}: {e}"
|
|
@@ -17,6 +17,9 @@ T = TypeVar("T")
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
class EventStream(Generic[T]):
|
|
20
|
+
# Holds a reference to the SDK client to avoid it being garbage collected
|
|
21
|
+
# and cause termination of the underlying httpx client.
|
|
22
|
+
client_ref: Optional[object]
|
|
20
23
|
response: httpx.Response
|
|
21
24
|
generator: Generator[T, None, None]
|
|
22
25
|
|
|
@@ -25,9 +28,11 @@ class EventStream(Generic[T]):
|
|
|
25
28
|
response: httpx.Response,
|
|
26
29
|
decoder: Callable[[str], T],
|
|
27
30
|
sentinel: Optional[str] = None,
|
|
31
|
+
client_ref: Optional[object] = None,
|
|
28
32
|
):
|
|
29
33
|
self.response = response
|
|
30
34
|
self.generator = stream_events(response, decoder, sentinel)
|
|
35
|
+
self.client_ref = client_ref
|
|
31
36
|
|
|
32
37
|
def __iter__(self):
|
|
33
38
|
return self
|
|
@@ -43,6 +48,9 @@ class EventStream(Generic[T]):
|
|
|
43
48
|
|
|
44
49
|
|
|
45
50
|
class EventStreamAsync(Generic[T]):
|
|
51
|
+
# Holds a reference to the SDK client to avoid it being garbage collected
|
|
52
|
+
# and cause termination of the underlying httpx client.
|
|
53
|
+
client_ref: Optional[object]
|
|
46
54
|
response: httpx.Response
|
|
47
55
|
generator: AsyncGenerator[T, None]
|
|
48
56
|
|
|
@@ -51,9 +59,11 @@ class EventStreamAsync(Generic[T]):
|
|
|
51
59
|
response: httpx.Response,
|
|
52
60
|
decoder: Callable[[str], T],
|
|
53
61
|
sentinel: Optional[str] = None,
|
|
62
|
+
client_ref: Optional[object] = None,
|
|
54
63
|
):
|
|
55
64
|
self.response = response
|
|
56
65
|
self.generator = stream_events_async(response, decoder, sentinel)
|
|
66
|
+
self.client_ref = client_ref
|
|
57
67
|
|
|
58
68
|
def __aiter__(self):
|
|
59
69
|
return self
|
|
@@ -3,17 +3,17 @@ 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=
|
|
7
|
-
syllable_sdk/agents.py,sha256=
|
|
8
|
-
syllable_sdk/basesdk.py,sha256=
|
|
6
|
+
syllable_sdk/_version.py,sha256=AAfU-m8Tw2z12g5h1iOrWyd-YFdHNtUnzHuk05rr85s,470
|
|
7
|
+
syllable_sdk/agents.py,sha256=8Mi55XEKRofGeW9iS5haXK-7wEd7Yo5M2ROH_x5sepQ,46796
|
|
8
|
+
syllable_sdk/basesdk.py,sha256=PCXez-bS_sOzXpRo7awDMzW4zqGJtktHytrlQfG1HNw,12211
|
|
9
9
|
syllable_sdk/batches.py,sha256=qgI5PRkdgLdaJl4DPfs4mBJrB0OY_CCDePYntyjleSs,73059
|
|
10
10
|
syllable_sdk/campaigns.py,sha256=MIw1sWFreiedJfhFuGg2lYbxOQDtwwsgI2TiS7AgnIM,40546
|
|
11
|
-
syllable_sdk/channels.py,sha256=
|
|
11
|
+
syllable_sdk/channels.py,sha256=IeQoEWTRblBlPlni7meJadLxD4Cq-5qyRwBnn_ZU-uY,34261
|
|
12
12
|
syllable_sdk/conversations.py,sha256=SjbYq8-mr2RdIh_JO_qxh25WvLkWXf_KsEUxhHRVlB4,10743
|
|
13
13
|
syllable_sdk/custom_messages.py,sha256=xM3Sy-bdXPYX-qUJUl_CfgjR0HtEpN32u1uXqc1X9x0,41307
|
|
14
14
|
syllable_sdk/dashboards.py,sha256=qvzxTiPnzJTmip02EPyGP-qaCgBtpZ4OPYJa2IGH1nw,45442
|
|
15
15
|
syllable_sdk/data_sources.py,sha256=ReOnnz4OYQupXW6aS7iHNJgK84aJEWN7vnuqn1eCYAs,40909
|
|
16
|
-
syllable_sdk/errors/__init__.py,sha256=
|
|
16
|
+
syllable_sdk/errors/__init__.py,sha256=b7YCOOsKA0VcV2bgdwU0w8lITftThPQ5QHX8sTisILk,2098
|
|
17
17
|
syllable_sdk/errors/apierror.py,sha256=CM3pZTIA9QnXmav_lDlcGgwyYLJ4pmMtni4Ck-iwFow,1234
|
|
18
18
|
syllable_sdk/errors/httpvalidationerror.py,sha256=wBTQY0G7zOW5nGyKkZDkEDc51htoMJTVBXO1mVYFh-4,794
|
|
19
19
|
syllable_sdk/errors/no_response_error.py,sha256=FQG44Lq6uF7uUlzbUYfM3dJon6sbqXzJ0Ri6YrDdsEs,380
|
|
@@ -24,11 +24,11 @@ syllable_sdk/folders.py,sha256=Yf8zZ3TY38nIWx8HEjmC13KciWxFYHCTUBOzRYAEdZ8,69452
|
|
|
24
24
|
syllable_sdk/full_summary.py,sha256=OMOJu6wE6IdiI54w72ljqKYvDbxzXvPu8lgfQhbniz0,7487
|
|
25
25
|
syllable_sdk/httpclient.py,sha256=Eu73urOAiZQtdUIyOUnPccxCiBbWEKrXG-JrRG3SLM4,3946
|
|
26
26
|
syllable_sdk/incidents.py,sha256=mkhdIEED5nBcwz3KvkdrpQEbSbRpKVpvXe4-5vYvqMU,46422
|
|
27
|
-
syllable_sdk/insights_sdk.py,sha256=
|
|
27
|
+
syllable_sdk/insights_sdk.py,sha256=i5cYTiUdIrbyB4Nm6xlDFOU6rdM9LeadH4XNzGcNX5E,12078
|
|
28
28
|
syllable_sdk/insights_tools.py,sha256=SuDEOpPtk7SlsFZ-thzIZSt_31WjofzyzqozseWQy3M,55115
|
|
29
29
|
syllable_sdk/language_groups.py,sha256=BlcTvh_KitUkbVzXlBjCcxTmBbQ12QWxCZfXqlCOoPc,49214
|
|
30
30
|
syllable_sdk/latency.py,sha256=PymvwBTs6KAVMl-IZVj6L4zJotRApBOcnkfB4FrlNkg,7449
|
|
31
|
-
syllable_sdk/models/__init__.py,sha256=
|
|
31
|
+
syllable_sdk/models/__init__.py,sha256=HbIFAAN4pCEqLLmf_gtOn5gmmhshWfn7EVFti9XkH9s,86220
|
|
32
32
|
syllable_sdk/models/agent_deleteop.py,sha256=tUbi-gwd4chf2Ba9O9lCvqDQw6YOnn7aheu8OPDzptc,629
|
|
33
33
|
syllable_sdk/models/agent_get_by_idop.py,sha256=vj_xEbhOv3c8n3-B3uQnfTwHWdxYSE4k3Zvr58Yc9A4,484
|
|
34
34
|
syllable_sdk/models/agent_listop.py,sha256=dJdQuIst1TF4xMol9XVdX4xOw8z06jyAQpm46_u0Ysk,5007
|
|
@@ -36,7 +36,7 @@ syllable_sdk/models/agentcreate.py,sha256=Yfvu4U3Q0prMFDFSTQPalr7FaVbTKoChcGofc_
|
|
|
36
36
|
syllable_sdk/models/agentlanguage.py,sha256=NkquRaZj2cPpm5bDSf2AuhHsL8NxDOYSDEO8YePUE4o,650
|
|
37
37
|
syllable_sdk/models/agentproperties.py,sha256=r7acQPPWRA7gZUMbhSrQMyDFw_A7RSRZdKo7yvgGQY0,792
|
|
38
38
|
syllable_sdk/models/agentresponse.py,sha256=pa6qBcPUF7LlK1Au29uuT6AN5dDiPDl8q1S1cc6LOqg,9689
|
|
39
|
-
syllable_sdk/models/agentsttprovider.py,sha256=
|
|
39
|
+
syllable_sdk/models/agentsttprovider.py,sha256=OPZ1f18o_PyJ3xBbAJaP-dQDCT082uE1sllWQzrfB5o,432
|
|
40
40
|
syllable_sdk/models/agenttooldefaults.py,sha256=grephhXpDNRoteEjin5eOFqe2pqh2WHs80wO9As87S4,903
|
|
41
41
|
syllable_sdk/models/agenttoolfielddefault.py,sha256=80ANVtg-F04tDjWvMj55g2xUujUIx-XtT-_lIQOiYnY,788
|
|
42
42
|
syllable_sdk/models/agentupdate.py,sha256=JyNM5fEMKzsrsk1Ydbr3pu0RyJdQZmv80gvsHm9miL8,6767
|
|
@@ -252,11 +252,11 @@ syllable_sdk/models/roleupdaterequest.py,sha256=0POkwVJolChgU9uQeiEPnvk-b3vj-OwS
|
|
|
252
252
|
syllable_sdk/models/security.py,sha256=cmcb8jzAhbaN9jiBBNy4BcT9cOXogAwTIbkC4BDe7o8,711
|
|
253
253
|
syllable_sdk/models/service_deleteop.py,sha256=xoOwlMCY2tHhDFRsWM7NUMrh5HUwiexssrUrq8DdfTk,637
|
|
254
254
|
syllable_sdk/models/service_listop.py,sha256=4y4IacaGYPLQTeApQvOO4GLk1J1liEddOdKxZx5tShs,5027
|
|
255
|
-
syllable_sdk/models/servicecreaterequest.py,sha256=
|
|
255
|
+
syllable_sdk/models/servicecreaterequest.py,sha256=jnwebYeG7gXgTpIVsV9qoK4rXTK_RQ8mLM9yK1uYIQg,3054
|
|
256
256
|
syllable_sdk/models/serviceproperties.py,sha256=EHFdvU1QBJp4RnJqBaBMb8zZ4XdKFTcY9nk24QxZHXc,392
|
|
257
257
|
syllable_sdk/models/serviceresponse.py,sha256=BgAhYy4ZPaaa7TzLCgnByXF0pxlZEn6Iy0XZmLHqgsU,3217
|
|
258
258
|
syllable_sdk/models/services_get_by_idop.py,sha256=y7p_wwbjkL-DRN3v20J_8JVe-aXeTL7WLtaYEmXOreA,494
|
|
259
|
-
syllable_sdk/models/serviceupdaterequest.py,sha256=
|
|
259
|
+
syllable_sdk/models/serviceupdaterequest.py,sha256=JMfYCiOFE_tBFxgcjRHYCEClK6EzN3mY5DUEpf0IVQ4,3469
|
|
260
260
|
syllable_sdk/models/session.py,sha256=_16iy4DPLJYeZt2TBqStkSy11j-FHmTBRiVcAi2QbqY,6971
|
|
261
261
|
syllable_sdk/models/session_full_summary_get_by_idop.py,sha256=9mvK1ONJebhTEbL7NxOMQqlk8r3kc56TfXkSaaVvGXQ,514
|
|
262
262
|
syllable_sdk/models/session_get_by_idop.py,sha256=snBsZ3SLmPa98ATGNRdoiL9GzSiZot-beY9DRPZtK24,492
|
|
@@ -334,31 +334,31 @@ syllable_sdk/models/validationerror.py,sha256=uxsoFicbgd_z1G43oIqm9zxSAulUONwaDM
|
|
|
334
334
|
syllable_sdk/models/voicesamplecreaterequest.py,sha256=HXpoJr5cH3DYeMq2sHZ0S92vNGnT2XGPs7BAzAK8K5o,3158
|
|
335
335
|
syllable_sdk/numbers.py,sha256=nqfC3Cex9wnLtavjKbQ_Aty0tQ3cYJCdS5IsEsSMPlI,24330
|
|
336
336
|
syllable_sdk/organizations.py,sha256=4lF7s0dX93hAek-Hsg99QDsYNlg79snldkLLlREN1e0,30066
|
|
337
|
-
syllable_sdk/outbound.py,sha256=
|
|
337
|
+
syllable_sdk/outbound.py,sha256=SKcqICw_VNT4vGDdu6b4TFh55hdA4Nh3QbZHbTs3MIc,902
|
|
338
338
|
syllable_sdk/permissions.py,sha256=EGDOu1toJfNgAEfS4Uv5QdWTPKvnPkH_DWGXDQdDhkk,6891
|
|
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=
|
|
342
|
+
syllable_sdk/sdk.py,sha256=7qR2MaxS7vBWJjnrz3MibNNDLbZO5MbNXAtovOR6-5g,16263
|
|
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
|
|
346
346
|
syllable_sdk/session_labels.py,sha256=_9pkwDKQ0Hwnb8neaAYS6ADcfd-Wf5CJXsMgSXaWHbc,25431
|
|
347
|
-
syllable_sdk/sessions.py,sha256=
|
|
347
|
+
syllable_sdk/sessions.py,sha256=glr2jmQwCtKhmugYn-A8ZmZo-13Scu4Cd7PvFLXTLmM,32729
|
|
348
348
|
syllable_sdk/takeouts.py,sha256=epDwpu4vpBiFiXBtfWRZlqJGdDWo9kop_SP3B06LpUk,20741
|
|
349
349
|
syllable_sdk/targets.py,sha256=hejkJHuIMzu3NLHMDGFkeI1O6Q7niNVoMGFmvQk3-LU,45152
|
|
350
350
|
syllable_sdk/test.py,sha256=PcbzlxEMiVhbrtpTo6VyjJse6d3D2uAwvganM1uG7as,8204
|
|
351
351
|
syllable_sdk/tools.py,sha256=HKAYTsNPzmjHbbrs-vczV_AtFWM5C-nbyyb5d8kLSZo,40028
|
|
352
352
|
syllable_sdk/transcript.py,sha256=JMvlIDPkvEiHXnHJMCxgjJM76jZmU95LNSNH5MJIZFU,7556
|
|
353
|
-
syllable_sdk/twilio.py,sha256=
|
|
353
|
+
syllable_sdk/twilio.py,sha256=gJ7rP637Wa3hGS8zo-SFOrTMrMmx0F2wXAMpAd9slg8,23423
|
|
354
354
|
syllable_sdk/types/__init__.py,sha256=RArOwSgeeTIva6h-4ttjXwMUeCkz10nAFBL9D-QljI4,377
|
|
355
355
|
syllable_sdk/types/basemodel.py,sha256=L79WXvTECbSqaJzs8D3ud_KdIWkU7Cx2wbohDAktE9E,1127
|
|
356
356
|
syllable_sdk/users.py,sha256=CQTR_esL0vCzwc3Z98c7vw2ZGIdHD1RZ4KI6cw6CH0g,53451
|
|
357
|
-
syllable_sdk/utils/__init__.py,sha256=
|
|
357
|
+
syllable_sdk/utils/__init__.py,sha256=CAG0O76aEToGKXpT6Ft87Vd-iiQTh4XdBrQ37BVbsiM,5861
|
|
358
358
|
syllable_sdk/utils/annotations.py,sha256=aR7mZG34FzgRdew7WZPYEu9QGBerpuKxCF4sek5Z_5Y,1699
|
|
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
|
-
syllable_sdk/utils/eventstreaming.py,sha256=
|
|
361
|
+
syllable_sdk/utils/eventstreaming.py,sha256=SgFqMcUOYKlrTQ4gAp_dNcKLvDXukeiEMNU3DP8mXk8,6692
|
|
362
362
|
syllable_sdk/utils/forms.py,sha256=EJdnrfIkuwpDtekyHutla0HjI_FypTYcmYNyPKEu_W0,6874
|
|
363
363
|
syllable_sdk/utils/headers.py,sha256=cPxWSmUILrefTGDzTH1Hdj7_Hlsj-EY6K5Tyc4iH4dk,3663
|
|
364
364
|
syllable_sdk/utils/logger.py,sha256=nPc714a9tLm0QMEvK0KYGr2Sko2xjbqq-tPnNGLpFIE,682
|
|
@@ -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.
|
|
377
|
-
syllable_sdk-0.
|
|
378
|
-
syllable_sdk-0.
|
|
376
|
+
syllable_sdk-0.36.1.dist-info/METADATA,sha256=DlKyfyBiFXyn-x5Ny8FWQT1HA0meM13106UKNLpSlKY,46165
|
|
377
|
+
syllable_sdk-0.36.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
378
|
+
syllable_sdk-0.36.1.dist-info/RECORD,,
|
|
File without changes
|