deepgram-sdk 3.0.0.dev10__tar.gz → 3.0.0.dev12__tar.gz
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.
- {deepgram-sdk-3.0.0.dev10/deepgram_sdk.egg-info → deepgram-sdk-3.0.0.dev12}/PKG-INFO +1 -1
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/__init__.py +3 -1
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/__init__.py +7 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/abstract_sync_client.py +14 -12
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/manage/v1/client.py +54 -53
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/onprem/v1/client.py +9 -8
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/prerecorded/__init__.py +8 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/prerecorded/v1/client.py +9 -4
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12/deepgram_sdk.egg-info}/PKG-INFO +1 -1
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/LICENSE +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/README.md +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/audio/__init__.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/audio/microphone/__init__.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/audio/microphone/constants.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/audio/microphone/errors.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/audio/microphone/microphone.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/client.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/abstract_async_client.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/errors.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/listen.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/live/__init__.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/live/client.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/live/enums.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/live/errors.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/live/helpers.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/live/v1/__init__.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/live/v1/async_client.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/live/v1/client.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/live/v1/options.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/live/v1/response.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/manage/__init__.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/manage/client.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/manage/v1/__init__.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/manage/v1/async_client.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/manage/v1/options.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/manage/v1/response.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/onprem/__init__.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/onprem/client.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/onprem/v1/__init__.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/onprem/v1/async_client.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/prerecorded/client.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/prerecorded/errors.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/prerecorded/helpers.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/prerecorded/source.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/prerecorded/v1/__init__.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/prerecorded/v1/async_client.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/prerecorded/v1/options.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/prerecorded/v1/response.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/errors.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/options.py +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram_sdk.egg-info/SOURCES.txt +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram_sdk.egg-info/dependency_links.txt +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram_sdk.egg-info/requires.txt +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram_sdk.egg-info/top_level.txt +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/pyproject.toml +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/setup.cfg +0 -0
- {deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/setup.py +0 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# SPDX-License-Identifier: MIT
|
|
4
4
|
|
|
5
5
|
# version
|
|
6
|
-
__version__ = "v3.0.0-dev.
|
|
6
|
+
__version__ = "v3.0.0-dev.12"
|
|
7
7
|
|
|
8
8
|
# entry point for the deepgram python sdk
|
|
9
9
|
from .client import DeepgramClient
|
|
@@ -27,6 +27,8 @@ from .clients import (
|
|
|
27
27
|
PrerecordedSource,
|
|
28
28
|
FileSource,
|
|
29
29
|
UrlSource,
|
|
30
|
+
BufferSource,
|
|
31
|
+
ReadStreamSource,
|
|
30
32
|
)
|
|
31
33
|
|
|
32
34
|
# manage
|
|
@@ -13,6 +13,13 @@ from ..options import DeepgramClientOptions
|
|
|
13
13
|
from .prerecorded import PreRecordedClient
|
|
14
14
|
from .prerecorded import AsyncPreRecordedClient
|
|
15
15
|
from .prerecorded import PrerecordedOptions
|
|
16
|
+
from .prerecorded import (
|
|
17
|
+
PrerecordedSource,
|
|
18
|
+
FileSource,
|
|
19
|
+
UrlSource,
|
|
20
|
+
BufferSource,
|
|
21
|
+
ReadStreamSource,
|
|
22
|
+
)
|
|
16
23
|
from ..options import DeepgramClientOptions
|
|
17
24
|
|
|
18
25
|
# onprem
|
{deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/abstract_sync_client.py
RENAMED
|
@@ -36,32 +36,34 @@ class AbstractSyncRestClient:
|
|
|
36
36
|
|
|
37
37
|
self.config = config
|
|
38
38
|
|
|
39
|
-
def get(self, url: str, options=None):
|
|
39
|
+
def get(self, url: str, options=None, timeout=None):
|
|
40
40
|
return self._handle_request(
|
|
41
|
-
"GET", url, params=options, headers=self.config.headers
|
|
41
|
+
"GET", url, params=options, headers=self.config.headers, timeout=timeout
|
|
42
42
|
)
|
|
43
43
|
|
|
44
|
-
def post(self, url: str, options=None, **kwargs):
|
|
44
|
+
def post(self, url: str, options=None, timeout=None, **kwargs):
|
|
45
45
|
return self._handle_request(
|
|
46
|
-
"POST", url, params=options, headers=self.config.headers, **kwargs
|
|
46
|
+
"POST", url, params=options, headers=self.config.headers, timeout=timeout, **kwargs
|
|
47
47
|
)
|
|
48
48
|
|
|
49
|
-
def put(self, url: str, options=None, **kwargs):
|
|
49
|
+
def put(self, url: str, options=None, timeout=None, **kwargs):
|
|
50
50
|
return self._handle_request(
|
|
51
|
-
"PUT", url, params=options, headers=self.config.headers, **kwargs
|
|
51
|
+
"PUT", url, params=options, headers=self.config.headers, timeout=timeout, **kwargs
|
|
52
52
|
)
|
|
53
53
|
|
|
54
|
-
def patch(self, url: str, options=None, **kwargs):
|
|
54
|
+
def patch(self, url: str, options=None, timeout=None, **kwargs):
|
|
55
55
|
return self._handle_request(
|
|
56
|
-
"PATCH", url, params=options, headers=self.config.headers, **kwargs
|
|
56
|
+
"PATCH", url, params=options, headers=self.config.headers, timeout=timeout, **kwargs
|
|
57
57
|
)
|
|
58
58
|
|
|
59
|
-
def delete(self, url: str):
|
|
60
|
-
return self._handle_request("DELETE", url, headers=self.config.headers)
|
|
59
|
+
def delete(self, url: str, timeout=None):
|
|
60
|
+
return self._handle_request("DELETE", url, headers=self.config.headers, timeout=timeout)
|
|
61
61
|
|
|
62
|
-
def _handle_request(self, method, url, **kwargs):
|
|
62
|
+
def _handle_request(self, method, url, timeout, **kwargs):
|
|
63
|
+
if timeout is None:
|
|
64
|
+
timeout = httpx.Timeout(10.0, connect=10.0)
|
|
63
65
|
try:
|
|
64
|
-
with httpx.Client() as client:
|
|
66
|
+
with httpx.Client(timeout=timeout) as client:
|
|
65
67
|
response = client.request(method, url, **kwargs)
|
|
66
68
|
response.raise_for_status()
|
|
67
69
|
return response.text
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
# Use of this source code is governed by a MIT license that can be found in the LICENSE file.
|
|
3
3
|
# SPDX-License-Identifier: MIT
|
|
4
4
|
|
|
5
|
+
import httpx
|
|
5
6
|
import logging, verboselogs
|
|
6
7
|
|
|
7
8
|
from ....options import DeepgramClientOptions
|
|
@@ -70,14 +71,14 @@ class ManageClient(AbstractSyncRestClient):
|
|
|
70
71
|
super().__init__(config)
|
|
71
72
|
|
|
72
73
|
# projects
|
|
73
|
-
def list_projects(self):
|
|
74
|
+
def list_projects(self, timeout: httpx.Timeout = None):
|
|
74
75
|
return self.get_projects()
|
|
75
76
|
|
|
76
|
-
def get_projects(self):
|
|
77
|
+
def get_projects(self, timeout: httpx.Timeout = None):
|
|
77
78
|
self.logger.debug("ManageClient.get_projects ENTER")
|
|
78
79
|
url = f"{self.config.url}/{self.endpoint}"
|
|
79
80
|
self.logger.info("url: %s", url)
|
|
80
|
-
json = self.get(url)
|
|
81
|
+
json = self.get(url, timeout=timeout)
|
|
81
82
|
self.logger.info("json: %s", json)
|
|
82
83
|
res = ProjectsResponse.from_json(json)
|
|
83
84
|
self.logger.verbose("result: %s", res)
|
|
@@ -85,12 +86,12 @@ class ManageClient(AbstractSyncRestClient):
|
|
|
85
86
|
self.logger.debug("ManageClient.get_projects LEAVE")
|
|
86
87
|
return res
|
|
87
88
|
|
|
88
|
-
def get_project(self, project_id: str):
|
|
89
|
+
def get_project(self, project_id: str, timeout: httpx.Timeout = None):
|
|
89
90
|
self.logger.debug("ManageClient.get_project ENTER")
|
|
90
91
|
url = f"{self.config.url}/{self.endpoint}/{project_id}"
|
|
91
92
|
self.logger.info("url: %s", url)
|
|
92
93
|
self.logger.info("project_id: %s", project_id)
|
|
93
|
-
json = self.get(url)
|
|
94
|
+
json = self.get(url, timeout=timeout)
|
|
94
95
|
self.logger.info("json: %s", json)
|
|
95
96
|
res = Project.from_json(json)
|
|
96
97
|
self.logger.verbose("result: %s", res)
|
|
@@ -98,13 +99,13 @@ class ManageClient(AbstractSyncRestClient):
|
|
|
98
99
|
self.logger.debug("ManageClient.get_project LEAVE")
|
|
99
100
|
return res
|
|
100
101
|
|
|
101
|
-
def update_project_option(self, project_id: str, options: ProjectOptions):
|
|
102
|
+
def update_project_option(self, project_id: str, options: ProjectOptions, timeout: httpx.Timeout = None):
|
|
102
103
|
self.logger.debug("ManageClient.update_project_option ENTER")
|
|
103
104
|
url = f"{self.config.url}/{self.endpoint}/{project_id}"
|
|
104
105
|
self.logger.info("url: %s", url)
|
|
105
106
|
self.logger.info("project_id: %s", project_id)
|
|
106
107
|
self.logger.info("options: %s", options)
|
|
107
|
-
json = self.patch(url, json=options)
|
|
108
|
+
json = self.patch(url, json=options, timeout=timeout)
|
|
108
109
|
self.logger.info("json: %s", json)
|
|
109
110
|
res = Message.from_json(json)
|
|
110
111
|
self.logger.verbose("result: %s", res)
|
|
@@ -112,7 +113,7 @@ class ManageClient(AbstractSyncRestClient):
|
|
|
112
113
|
self.logger.debug("ManageClient.update_project_option LEAVE")
|
|
113
114
|
return res
|
|
114
115
|
|
|
115
|
-
def update_project(self, project_id: str, name=""):
|
|
116
|
+
def update_project(self, project_id: str, name="", timeout: httpx.Timeout = None):
|
|
116
117
|
self.logger.debug("ManageClient.update_project ENTER")
|
|
117
118
|
url = f"{self.config.url}/{self.endpoint}/{project_id}"
|
|
118
119
|
options: ProjectOptions = {
|
|
@@ -121,7 +122,7 @@ class ManageClient(AbstractSyncRestClient):
|
|
|
121
122
|
self.logger.info("url: %s", url)
|
|
122
123
|
self.logger.info("project_id: %s", project_id)
|
|
123
124
|
self.logger.info("options: %s", options)
|
|
124
|
-
json = self.patch(url, json=options)
|
|
125
|
+
json = self.patch(url, json=options, timeout=timeout)
|
|
125
126
|
self.logger.info("json: %s", json)
|
|
126
127
|
res = Message.from_json(json)
|
|
127
128
|
self.logger.verbose("result: %s", res)
|
|
@@ -129,11 +130,11 @@ class ManageClient(AbstractSyncRestClient):
|
|
|
129
130
|
self.logger.debug("ManageClient.update_project LEAVE")
|
|
130
131
|
return res
|
|
131
132
|
|
|
132
|
-
def delete_project(self, project_id: str) -> None:
|
|
133
|
+
def delete_project(self, project_id: str, timeout: httpx.Timeout = None) -> None:
|
|
133
134
|
self.logger.debug("ManageClient.delete_project ENTER")
|
|
134
135
|
url = f"{self.config.url}/{self.endpoint}/{project_id}"
|
|
135
136
|
json = self.delete(url)
|
|
136
|
-
self.logger.info("json: %s", json)
|
|
137
|
+
self.logger.info("json: %s", json, timeout=timeout)
|
|
137
138
|
res = Message.from_json(self.delete(url))
|
|
138
139
|
self.logger.verbose("result: %s", res)
|
|
139
140
|
self.logger.notice("delete_project succeeded")
|
|
@@ -141,15 +142,15 @@ class ManageClient(AbstractSyncRestClient):
|
|
|
141
142
|
return res
|
|
142
143
|
|
|
143
144
|
# keys
|
|
144
|
-
def list_keys(self, project_id: str):
|
|
145
|
+
def list_keys(self, project_id: str, timeout: httpx.Timeout = None):
|
|
145
146
|
return self.get_keys(project_id)
|
|
146
147
|
|
|
147
|
-
def get_keys(self, project_id: str):
|
|
148
|
+
def get_keys(self, project_id: str, timeout: httpx.Timeout = None):
|
|
148
149
|
self.logger.debug("ManageClient.get_keys ENTER")
|
|
149
150
|
url = f"{self.config.url}/{self.endpoint}/{project_id}/keys"
|
|
150
151
|
self.logger.info("url: %s", url)
|
|
151
152
|
self.logger.info("project_id: %s", project_id)
|
|
152
|
-
json = self.get(url)
|
|
153
|
+
json = self.get(url, timeout=timeout)
|
|
153
154
|
self.logger.info("json: %s", json)
|
|
154
155
|
res = KeysResponse.from_json(json)
|
|
155
156
|
self.logger.verbose("result: %s", res)
|
|
@@ -157,13 +158,13 @@ class ManageClient(AbstractSyncRestClient):
|
|
|
157
158
|
self.logger.debug("ManageClient.get_keys LEAVE")
|
|
158
159
|
return res
|
|
159
160
|
|
|
160
|
-
def get_key(self, project_id: str, key_id: str):
|
|
161
|
+
def get_key(self, project_id: str, key_id: str, timeout: httpx.Timeout = None):
|
|
161
162
|
self.logger.debug("ManageClient.get_key ENTER")
|
|
162
163
|
url = f"{self.config.url}/{self.endpoint}/{project_id}/keys/{key_id}"
|
|
163
164
|
self.logger.info("url: %s", url)
|
|
164
165
|
self.logger.info("project_id: %s", project_id)
|
|
165
166
|
self.logger.info("key_id: %s", key_id)
|
|
166
|
-
json = self.get(url)
|
|
167
|
+
json = self.get(url, timeout=timeout)
|
|
167
168
|
self.logger.info("json: %s", json)
|
|
168
169
|
res = KeyResponse.from_json(json)
|
|
169
170
|
self.logger.verbose("result: %s", res)
|
|
@@ -171,13 +172,13 @@ class ManageClient(AbstractSyncRestClient):
|
|
|
171
172
|
self.logger.debug("ManageClient.get_key LEAVE")
|
|
172
173
|
return res
|
|
173
174
|
|
|
174
|
-
def create_key(self, project_id: str, options: KeyOptions):
|
|
175
|
+
def create_key(self, project_id: str, options: KeyOptions, timeout: httpx.Timeout = None):
|
|
175
176
|
self.logger.debug("ManageClient.create_key ENTER")
|
|
176
177
|
url = f"{self.config.url}/{self.endpoint}/{project_id}/keys"
|
|
177
178
|
self.logger.info("url: %s", url)
|
|
178
179
|
self.logger.info("project_id: %s", project_id)
|
|
179
180
|
self.logger.info("options: %s", options)
|
|
180
|
-
json = self.post(url, json=options)
|
|
181
|
+
json = self.post(url, json=options, timeout=timeout)
|
|
181
182
|
self.logger.info("json: %s", json)
|
|
182
183
|
res = Key.from_json(json)
|
|
183
184
|
self.logger.verbose("result: %s", res)
|
|
@@ -185,13 +186,13 @@ class ManageClient(AbstractSyncRestClient):
|
|
|
185
186
|
self.logger.debug("ManageClient.create_key LEAVE")
|
|
186
187
|
return res
|
|
187
188
|
|
|
188
|
-
def delete_key(self, project_id: str, key_id: str) -> None:
|
|
189
|
+
def delete_key(self, project_id: str, key_id: str, timeout: httpx.Timeout = None) -> None:
|
|
189
190
|
self.logger.debug("ManageClient.delete_key ENTER")
|
|
190
191
|
url = f"{self.config.url}/{self.endpoint}/{project_id}/keys/{key_id}"
|
|
191
192
|
self.logger.info("url: %s", url)
|
|
192
193
|
self.logger.info("project_id: %s", project_id)
|
|
193
194
|
self.logger.info("key_id: %s", key_id)
|
|
194
|
-
json = self.delete(url)
|
|
195
|
+
json = self.delete(url, timeout=timeout)
|
|
195
196
|
self.logger.info("json: %s", json)
|
|
196
197
|
res = Message.from_json(json)
|
|
197
198
|
self.logger.verbose("result: %s", res)
|
|
@@ -200,15 +201,15 @@ class ManageClient(AbstractSyncRestClient):
|
|
|
200
201
|
return res
|
|
201
202
|
|
|
202
203
|
# members
|
|
203
|
-
def list_members(self, project_id: str):
|
|
204
|
+
def list_members(self, project_id: str, timeout: httpx.Timeout = None):
|
|
204
205
|
return self.get_members(project_id)
|
|
205
206
|
|
|
206
|
-
def get_members(self, project_id: str):
|
|
207
|
+
def get_members(self, project_id: str, timeout: httpx.Timeout = None):
|
|
207
208
|
self.logger.debug("ManageClient.get_members ENTER")
|
|
208
209
|
url = f"{self.config.url}/{self.endpoint}/{project_id}/members"
|
|
209
210
|
self.logger.info("url: %s", url)
|
|
210
211
|
self.logger.info("project_id: %s", project_id)
|
|
211
|
-
json = self.get(url)
|
|
212
|
+
json = self.get(url, timeout=timeout)
|
|
212
213
|
self.logger.info("json: %s", json)
|
|
213
214
|
res = MembersResponse.from_json(json)
|
|
214
215
|
self.logger.verbose("result: %s", res)
|
|
@@ -216,13 +217,13 @@ class ManageClient(AbstractSyncRestClient):
|
|
|
216
217
|
self.logger.debug("ManageClient.get_members LEAVE")
|
|
217
218
|
return res
|
|
218
219
|
|
|
219
|
-
def remove_member(self, project_id: str, member_id: str) -> None:
|
|
220
|
+
def remove_member(self, project_id: str, member_id: str, timeout: httpx.Timeout = None) -> None:
|
|
220
221
|
self.logger.debug("ManageClient.remove_member ENTER")
|
|
221
222
|
url = f"{self.config.url}/{self.endpoint}/{project_id}/members/{member_id}"
|
|
222
223
|
self.logger.info("url: %s", url)
|
|
223
224
|
self.logger.info("project_id: %s", project_id)
|
|
224
225
|
self.logger.info("member_id: %s", member_id)
|
|
225
|
-
json = self.delete(url)
|
|
226
|
+
json = self.delete(url, timeout=timeout)
|
|
226
227
|
self.logger.info("json: %s", json)
|
|
227
228
|
res = Message.from_json(json)
|
|
228
229
|
self.logger.verbose("result: %s", res)
|
|
@@ -231,7 +232,7 @@ class ManageClient(AbstractSyncRestClient):
|
|
|
231
232
|
return res
|
|
232
233
|
|
|
233
234
|
# scopes
|
|
234
|
-
def get_member_scopes(self, project_id: str, member_id: str):
|
|
235
|
+
def get_member_scopes(self, project_id: str, member_id: str, timeout: httpx.Timeout = None):
|
|
235
236
|
self.logger.debug("ManageClient.get_member_scopes ENTER")
|
|
236
237
|
url = (
|
|
237
238
|
f"{self.config.url}/{self.endpoint}/{project_id}/members/{member_id}/scopes"
|
|
@@ -239,7 +240,7 @@ class ManageClient(AbstractSyncRestClient):
|
|
|
239
240
|
self.logger.info("url: %s", url)
|
|
240
241
|
self.logger.info("project_id: %s", project_id)
|
|
241
242
|
self.logger.info("member_id: %s", member_id)
|
|
242
|
-
json = self.get(url)
|
|
243
|
+
json = self.get(url, timeout=timeout)
|
|
243
244
|
self.logger.info("json: %s", json)
|
|
244
245
|
res = ScopesResponse.from_json(json)
|
|
245
246
|
self.logger.verbose("result: %s", res)
|
|
@@ -248,7 +249,7 @@ class ManageClient(AbstractSyncRestClient):
|
|
|
248
249
|
return res
|
|
249
250
|
|
|
250
251
|
def update_member_scope(
|
|
251
|
-
self, project_id: str, member_id: str, options: ScopeOptions
|
|
252
|
+
self, project_id: str, member_id: str, options: ScopeOptions, timeout: httpx.Timeout = None
|
|
252
253
|
):
|
|
253
254
|
self.logger.debug("ManageClient.update_member_scope ENTER")
|
|
254
255
|
url = (
|
|
@@ -257,7 +258,7 @@ class ManageClient(AbstractSyncRestClient):
|
|
|
257
258
|
self.logger.info("url: %s", url)
|
|
258
259
|
self.logger.info("project_id: %s", project_id)
|
|
259
260
|
self.logger.info("options: %s", options)
|
|
260
|
-
json = self.put(url, json=options)
|
|
261
|
+
json = self.put(url, json=options, timeout=timeout)
|
|
261
262
|
self.logger.info("json: %s", json)
|
|
262
263
|
res = Message.from_json(json)
|
|
263
264
|
self.logger.verbose("result: %s", res)
|
|
@@ -266,15 +267,15 @@ class ManageClient(AbstractSyncRestClient):
|
|
|
266
267
|
return res
|
|
267
268
|
|
|
268
269
|
# invites
|
|
269
|
-
def list_invites(self, project_id: str):
|
|
270
|
+
def list_invites(self, project_id: str, timeout: httpx.Timeout = None):
|
|
270
271
|
return self.get_invites(project_id)
|
|
271
272
|
|
|
272
|
-
def get_invites(self, project_id: str):
|
|
273
|
+
def get_invites(self, project_id: str, timeout: httpx.Timeout = None):
|
|
273
274
|
self.logger.debug("ManageClient.get_invites ENTER")
|
|
274
275
|
url = f"{self.config.url}/{self.endpoint}/{project_id}/invites"
|
|
275
276
|
self.logger.info("url: %s", url)
|
|
276
277
|
self.logger.info("project_id: %s", project_id)
|
|
277
|
-
json = self.get(url)
|
|
278
|
+
json = self.get(url, timeout=timeout)
|
|
278
279
|
self.logger.info("json: %s", json)
|
|
279
280
|
res = InvitesResponse.from_json(json)
|
|
280
281
|
self.logger.verbose("result: %s", res)
|
|
@@ -282,13 +283,13 @@ class ManageClient(AbstractSyncRestClient):
|
|
|
282
283
|
self.logger.debug("ManageClient.get_invites LEAVE")
|
|
283
284
|
return res
|
|
284
285
|
|
|
285
|
-
def send_invite_options(self, project_id: str, options: InviteOptions):
|
|
286
|
+
def send_invite_options(self, project_id: str, options: InviteOptions, timeout: httpx.Timeout = None):
|
|
286
287
|
self.logger.debug("ManageClient.send_invite_options ENTER")
|
|
287
288
|
url = f"{self.config.url}/{self.endpoint}/{project_id}/invites"
|
|
288
289
|
self.logger.info("url: %s", url)
|
|
289
290
|
self.logger.info("project_id: %s", project_id)
|
|
290
291
|
self.logger.info("options: %s", options)
|
|
291
|
-
json = self.post(url, json=options)
|
|
292
|
+
json = self.post(url, json=options, timeout=timeout)
|
|
292
293
|
self.logger.info("json: %s", json)
|
|
293
294
|
res = Message.from_json(json)
|
|
294
295
|
self.logger.verbose("result: %s", res)
|
|
@@ -296,7 +297,7 @@ class ManageClient(AbstractSyncRestClient):
|
|
|
296
297
|
self.logger.debug("ManageClient.send_invite_options LEAVE")
|
|
297
298
|
return res
|
|
298
299
|
|
|
299
|
-
def send_invite(self, project_id: str, email: str, scope="member"):
|
|
300
|
+
def send_invite(self, project_id: str, email: str, scope="member", timeout: httpx.Timeout = None):
|
|
300
301
|
self.logger.debug("ManageClient.send_invite ENTER")
|
|
301
302
|
url = f"{self.config.url}/{self.endpoint}/{project_id}/invites"
|
|
302
303
|
options: InviteOptions = {
|
|
@@ -306,7 +307,7 @@ class ManageClient(AbstractSyncRestClient):
|
|
|
306
307
|
self.logger.info("url: %s", url)
|
|
307
308
|
self.logger.info("project_id: %s", project_id)
|
|
308
309
|
self.logger.info("options: %s", options)
|
|
309
|
-
json = self.post(url, json=options)
|
|
310
|
+
json = self.post(url, json=options, timeout=timeout)
|
|
310
311
|
self.logger.info("json: %s", json)
|
|
311
312
|
res = Message.from_json(json)
|
|
312
313
|
self.logger.verbose("result: %s", res)
|
|
@@ -314,13 +315,13 @@ class ManageClient(AbstractSyncRestClient):
|
|
|
314
315
|
self.logger.debug("ManageClient.send_invite LEAVE")
|
|
315
316
|
return res
|
|
316
317
|
|
|
317
|
-
def delete_invite(self, project_id: str, email: str):
|
|
318
|
+
def delete_invite(self, project_id: str, email: str, timeout: httpx.Timeout = None):
|
|
318
319
|
self.logger.debug("ManageClient.delete_invite ENTER")
|
|
319
320
|
url = f"{self.config.url}/{self.endpoint}/{project_id}/invites/{email}"
|
|
320
321
|
self.logger.info("url: %s", url)
|
|
321
322
|
self.logger.info("project_id: %s", project_id)
|
|
322
323
|
self.logger.info("email: %s", email)
|
|
323
|
-
json = self.delete(url)
|
|
324
|
+
json = self.delete(url, timeout=timeout)
|
|
324
325
|
self.logger.info("json: %s", json)
|
|
325
326
|
res = Message.from_json(json)
|
|
326
327
|
self.logger.verbose("result: %s", res)
|
|
@@ -328,12 +329,12 @@ class ManageClient(AbstractSyncRestClient):
|
|
|
328
329
|
self.logger.debug("ManageClient.delete_invite LEAVE")
|
|
329
330
|
return res
|
|
330
331
|
|
|
331
|
-
def leave_project(self, project_id: str):
|
|
332
|
+
def leave_project(self, project_id: str, timeout: httpx.Timeout = None):
|
|
332
333
|
self.logger.debug("ManageClient.leave_project ENTER")
|
|
333
334
|
url = f"{self.config.url}/{self.endpoint}/{project_id}/leave"
|
|
334
335
|
self.logger.info("url: %s", url)
|
|
335
336
|
self.logger.info("project_id: %s", project_id)
|
|
336
|
-
json = self.delete(url)
|
|
337
|
+
json = self.delete(url, timeout=timeout)
|
|
337
338
|
self.logger.info("json: %s", json)
|
|
338
339
|
res = Message.from_json(json)
|
|
339
340
|
self.logger.verbose("result: %s", res)
|
|
@@ -342,13 +343,13 @@ class ManageClient(AbstractSyncRestClient):
|
|
|
342
343
|
return res
|
|
343
344
|
|
|
344
345
|
# usage
|
|
345
|
-
def get_usage_requests(self, project_id: str, options: UsageRequestOptions):
|
|
346
|
+
def get_usage_requests(self, project_id: str, options: UsageRequestOptions, timeout: httpx.Timeout = None):
|
|
346
347
|
self.logger.debug("ManageClient.get_usage_requests ENTER")
|
|
347
348
|
url = f"{self.config.url}/{self.endpoint}/{project_id}/requests"
|
|
348
349
|
self.logger.info("url: %s", url)
|
|
349
350
|
self.logger.info("project_id: %s", project_id)
|
|
350
351
|
self.logger.info("options: %s", options)
|
|
351
|
-
json = self.get(url, options)
|
|
352
|
+
json = self.get(url, options, timeout=timeout)
|
|
352
353
|
self.logger.info("json: %s", json)
|
|
353
354
|
res = UsageRequestsResponse.from_json(json)
|
|
354
355
|
self.logger.verbose("result: %s", res)
|
|
@@ -356,13 +357,13 @@ class ManageClient(AbstractSyncRestClient):
|
|
|
356
357
|
self.logger.debug("ManageClient.get_usage_requests LEAVE")
|
|
357
358
|
return res
|
|
358
359
|
|
|
359
|
-
def get_usage_request(self, project_id: str, request_id: str):
|
|
360
|
+
def get_usage_request(self, project_id: str, request_id: str, timeout: httpx.Timeout = None):
|
|
360
361
|
self.logger.debug("ManageClient.get_usage_request ENTER")
|
|
361
362
|
url = f"{self.config.url}/{self.endpoint}/{project_id}/requests/{request_id}"
|
|
362
363
|
self.logger.info("url: %s", url)
|
|
363
364
|
self.logger.info("project_id: %s", project_id)
|
|
364
365
|
self.logger.info("request_id: %s", request_id)
|
|
365
|
-
json = self.get(url)
|
|
366
|
+
json = self.get(url, timeout=timeout)
|
|
366
367
|
self.logger.info("json: %s", json)
|
|
367
368
|
res = UsageRequest.from_json(json)
|
|
368
369
|
self.logger.verbose("result: %s", res)
|
|
@@ -370,13 +371,13 @@ class ManageClient(AbstractSyncRestClient):
|
|
|
370
371
|
self.logger.debug("ManageClient.get_usage_request LEAVE")
|
|
371
372
|
return res
|
|
372
373
|
|
|
373
|
-
def get_usage_summary(self, project_id: str, options: UsageSummaryOptions):
|
|
374
|
+
def get_usage_summary(self, project_id: str, options: UsageSummaryOptions, timeout: httpx.Timeout = None):
|
|
374
375
|
self.logger.debug("ManageClient.get_usage_summary ENTER")
|
|
375
376
|
url = f"{self.config.url}/{self.endpoint}/{project_id}/usage"
|
|
376
377
|
self.logger.info("url: %s", url)
|
|
377
378
|
self.logger.info("project_id: %s", project_id)
|
|
378
379
|
self.logger.info("options: %s", options)
|
|
379
|
-
json = self.get(url, options)
|
|
380
|
+
json = self.get(url, options, timeout=timeout)
|
|
380
381
|
self.logger.info("json: %s", json)
|
|
381
382
|
res = UsageSummaryResponse.from_json(json)
|
|
382
383
|
self.logger.verbose("result: %s", res)
|
|
@@ -384,13 +385,13 @@ class ManageClient(AbstractSyncRestClient):
|
|
|
384
385
|
self.logger.debug("ManageClient.get_usage_summary LEAVE")
|
|
385
386
|
return res
|
|
386
387
|
|
|
387
|
-
def get_usage_fields(self, project_id: str, options: UsageFieldsOptions):
|
|
388
|
+
def get_usage_fields(self, project_id: str, options: UsageFieldsOptions, timeout: httpx.Timeout = None):
|
|
388
389
|
self.logger.debug("ManageClient.get_usage_fields ENTER")
|
|
389
390
|
url = f"{self.config.url}/{self.endpoint}/{project_id}/usage/fields"
|
|
390
391
|
self.logger.info("url: %s", url)
|
|
391
392
|
self.logger.info("project_id: %s", project_id)
|
|
392
393
|
self.logger.info("options: %s", options)
|
|
393
|
-
json = self.get(url, options)
|
|
394
|
+
json = self.get(url, options, timeout=timeout)
|
|
394
395
|
self.logger.info("json: %s", json)
|
|
395
396
|
res = UsageFieldsResponse.from_json(json)
|
|
396
397
|
self.logger.verbose("result: %s", res)
|
|
@@ -399,15 +400,15 @@ class ManageClient(AbstractSyncRestClient):
|
|
|
399
400
|
return res
|
|
400
401
|
|
|
401
402
|
# balances
|
|
402
|
-
def list_balances(self, project_id: str):
|
|
403
|
+
def list_balances(self, project_id: str, timeout: httpx.Timeout = None):
|
|
403
404
|
return self.get_balances(project_id)
|
|
404
405
|
|
|
405
|
-
def get_balances(self, project_id: str):
|
|
406
|
+
def get_balances(self, project_id: str, timeout: httpx.Timeout = None):
|
|
406
407
|
self.logger.debug("ManageClient.get_balances ENTER")
|
|
407
408
|
url = f"{self.config.url}/{self.endpoint}/{project_id}/balances"
|
|
408
409
|
self.logger.info("url: %s", url)
|
|
409
410
|
self.logger.info("project_id: %s", project_id)
|
|
410
|
-
json = self.get(url)
|
|
411
|
+
json = self.get(url, timeout=timeout)
|
|
411
412
|
self.logger.info("json: %s", json)
|
|
412
413
|
res = BalancesResponse.from_json(json)
|
|
413
414
|
self.logger.verbose("result: %s", res)
|
|
@@ -415,13 +416,13 @@ class ManageClient(AbstractSyncRestClient):
|
|
|
415
416
|
self.logger.debug("ManageClient.get_balances LEAVE")
|
|
416
417
|
return res
|
|
417
418
|
|
|
418
|
-
def get_balance(self, project_id: str, balance_id: str):
|
|
419
|
+
def get_balance(self, project_id: str, balance_id: str, timeout: httpx.Timeout = None):
|
|
419
420
|
self.logger.debug("ManageClient.get_balance ENTER")
|
|
420
421
|
url = f"{self.config.url}/{self.endpoint}/{project_id}/balances/{balance_id}"
|
|
421
422
|
self.logger.info("url: %s", url)
|
|
422
423
|
self.logger.info("project_id: %s", project_id)
|
|
423
424
|
self.logger.info("balance_id: %s", balance_id)
|
|
424
|
-
json = self.get(url)
|
|
425
|
+
json = self.get(url, timeout=timeout)
|
|
425
426
|
self.logger.info("json: %s", json)
|
|
426
427
|
res = Balance.from_json(json)
|
|
427
428
|
self.logger.verbose("result: %s", res)
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
# Use of this source code is governed by a MIT license that can be found in the LICENSE file.
|
|
3
3
|
# SPDX-License-Identifier: MIT
|
|
4
4
|
|
|
5
|
+
import httpx
|
|
5
6
|
import logging, verboselogs
|
|
6
7
|
|
|
7
8
|
from ...abstract_sync_client import AbstractSyncRestClient
|
|
@@ -35,50 +36,50 @@ class OnPremClient(AbstractSyncRestClient):
|
|
|
35
36
|
self.endpoint = "v1/projects"
|
|
36
37
|
super().__init__(config)
|
|
37
38
|
|
|
38
|
-
def list_onprem_credentials(self, project_id: str):
|
|
39
|
+
def list_onprem_credentials(self, project_id: str, timeout: httpx.Timeout = None):
|
|
39
40
|
self.logger.debug("OnPremClient.list_onprem_credentials ENTER")
|
|
40
41
|
url = f"{self.config.url}/{self.endpoint}/{project_id}/onprem/distribution/credentials"
|
|
41
42
|
self.logger.info("url: %s", url)
|
|
42
43
|
self.logger.info("project_id: %s", project_id)
|
|
43
|
-
res = self.get(url)
|
|
44
|
+
res = self.get(url, timeout=timeout)
|
|
44
45
|
self.logger.verbose("result: %s", res)
|
|
45
46
|
self.logger.notice("list_onprem_credentials succeeded")
|
|
46
47
|
self.logger.debug("OnPremClient.list_onprem_credentials LEAVE")
|
|
47
48
|
return res
|
|
48
49
|
|
|
49
|
-
def get_onprem_credentials(self, project_id: str, distribution_credentials_id: str):
|
|
50
|
+
def get_onprem_credentials(self, project_id: str, distribution_credentials_id: str, timeout: httpx.Timeout = None):
|
|
50
51
|
self.logger.debug("OnPremClient.get_onprem_credentials ENTER")
|
|
51
52
|
url = f"{self.config.url}/{self.endpoint}/{project_id}/onprem/distribution/credentials/{distribution_credentials_id}"
|
|
52
53
|
self.logger.info("url: %s", url)
|
|
53
54
|
self.logger.info("project_id: %s", project_id)
|
|
54
55
|
self.logger.info("distribution_credentials_id: %s", distribution_credentials_id)
|
|
55
|
-
res = self.get(url)
|
|
56
|
+
res = self.get(url, timeout=timeout)
|
|
56
57
|
self.logger.verbose("result: %s", res)
|
|
57
58
|
self.logger.notice("get_onprem_credentials succeeded")
|
|
58
59
|
self.logger.debug("OnPremClient.get_onprem_credentials LEAVE")
|
|
59
60
|
return res
|
|
60
61
|
|
|
61
|
-
def create_onprem_credentials(self, project_id: str, options):
|
|
62
|
+
def create_onprem_credentials(self, project_id: str, options, timeout: httpx.Timeout = None):
|
|
62
63
|
self.logger.debug("OnPremClient.create_onprem_credentials ENTER")
|
|
63
64
|
url = f"{self.config.url}/{self.endpoint}/{project_id}/onprem/distribution/credentials/"
|
|
64
65
|
self.logger.info("url: %s", url)
|
|
65
66
|
self.logger.info("project_id: %s", project_id)
|
|
66
67
|
self.logger.info("options: %s", options)
|
|
67
|
-
res = self.post(url, json=options)
|
|
68
|
+
res = self.post(url, json=options, timeout=timeout)
|
|
68
69
|
self.logger.verbose("result: %s", res)
|
|
69
70
|
self.logger.notice("create_onprem_credentials succeeded")
|
|
70
71
|
self.logger.debug("OnPremClient.create_onprem_credentials LEAVE")
|
|
71
72
|
return res
|
|
72
73
|
|
|
73
74
|
def delete_onprem_credentials(
|
|
74
|
-
self, project_id: str, distribution_credentials_id: str
|
|
75
|
+
self, project_id: str, distribution_credentials_id: str, timeout: httpx.Timeout = None
|
|
75
76
|
):
|
|
76
77
|
self.logger.debug("OnPremClient.delete_onprem_credentials ENTER")
|
|
77
78
|
url = f"{self.config.url}/{self.endpoint}/{project_id}/onprem/distribution/credentials/{distribution_credentials_id}"
|
|
78
79
|
self.logger.info("url: %s", url)
|
|
79
80
|
self.logger.info("project_id: %s", project_id)
|
|
80
81
|
self.logger.info("distrbution_credentials_id: %s", distribution_credentials_id)
|
|
81
|
-
res = self.delete(url)
|
|
82
|
+
res = self.delete(url, timeout=timeout)
|
|
82
83
|
self.logger.verbose("result: %s", res)
|
|
83
84
|
self.logger.notice("delete_onprem_credentials succeeded")
|
|
84
85
|
self.logger.debug("OnPremClient.delete_onprem_credentials LEAVE")
|
{deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/prerecorded/__init__.py
RENAMED
|
@@ -5,4 +5,12 @@
|
|
|
5
5
|
from .v1.client import PreRecordedClient
|
|
6
6
|
from .v1.async_client import AsyncPreRecordedClient
|
|
7
7
|
from .v1.options import PrerecordedOptions
|
|
8
|
+
from .source import (
|
|
9
|
+
PrerecordedSource,
|
|
10
|
+
FileSource,
|
|
11
|
+
UrlSource,
|
|
12
|
+
BufferSource,
|
|
13
|
+
ReadStreamSource,
|
|
14
|
+
)
|
|
15
|
+
|
|
8
16
|
from ...options import DeepgramClientOptions
|
{deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/prerecorded/v1/client.py
RENAMED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
# Use of this source code is governed by a MIT license that can be found in the LICENSE file.
|
|
3
3
|
# SPDX-License-Identifier: MIT
|
|
4
4
|
|
|
5
|
+
import httpx
|
|
5
6
|
import logging, verboselogs
|
|
6
7
|
import inspect
|
|
7
8
|
|
|
@@ -48,6 +49,7 @@ class PreRecordedClient(AbstractSyncRestClient):
|
|
|
48
49
|
self,
|
|
49
50
|
source: UrlSource,
|
|
50
51
|
options: PrerecordedOptions = None,
|
|
52
|
+
timeout: httpx.Timeout = None,
|
|
51
53
|
endpoint: str = "v1/listen",
|
|
52
54
|
) -> PrerecordedResponse:
|
|
53
55
|
self.logger.debug("PreRecordedClient.transcribe_url ENTER")
|
|
@@ -70,7 +72,7 @@ class PreRecordedClient(AbstractSyncRestClient):
|
|
|
70
72
|
if isinstance(options, PrerecordedOptions):
|
|
71
73
|
self.logger.info("PrerecordedOptions switching class -> json")
|
|
72
74
|
options = options.to_json()
|
|
73
|
-
res = PrerecordedResponse.from_json(self.post(url, options, json=body))
|
|
75
|
+
res = PrerecordedResponse.from_json(self.post(url, options, json=body, timeout=timeout))
|
|
74
76
|
self.logger.verbose("result: %s", res)
|
|
75
77
|
self.logger.notice("transcribe_url succeeded")
|
|
76
78
|
self.logger.debug("PreRecordedClient.transcribe_url LEAVE")
|
|
@@ -99,6 +101,7 @@ class PreRecordedClient(AbstractSyncRestClient):
|
|
|
99
101
|
source: UrlSource,
|
|
100
102
|
callback: str,
|
|
101
103
|
options: PrerecordedOptions = None,
|
|
104
|
+
timeout: httpx.Timeout = None,
|
|
102
105
|
endpoint: str = "v1/listen",
|
|
103
106
|
) -> AsyncPrerecordedResponse:
|
|
104
107
|
self.logger.debug("PreRecordedClient.transcribe_url_callback ENTER")
|
|
@@ -120,7 +123,7 @@ class PreRecordedClient(AbstractSyncRestClient):
|
|
|
120
123
|
if isinstance(options, PrerecordedOptions):
|
|
121
124
|
self.logger.info("PrerecordedOptions switching class -> json")
|
|
122
125
|
options = options.to_json()
|
|
123
|
-
json = self.post(url, options, json=body)
|
|
126
|
+
json = self.post(url, options, json=body, timeout=timeout)
|
|
124
127
|
self.logger.info("json: %s", json)
|
|
125
128
|
res = AsyncPrerecordedResponse.from_json(json)
|
|
126
129
|
self.logger.verbose("result: %s", res)
|
|
@@ -150,6 +153,7 @@ class PreRecordedClient(AbstractSyncRestClient):
|
|
|
150
153
|
self,
|
|
151
154
|
source: FileSource,
|
|
152
155
|
options: PrerecordedOptions = None,
|
|
156
|
+
timeout: httpx.Timeout = None,
|
|
153
157
|
endpoint: str = "v1/listen",
|
|
154
158
|
) -> PrerecordedResponse:
|
|
155
159
|
self.logger.debug("PreRecordedClient.transcribe_file ENTER")
|
|
@@ -169,7 +173,7 @@ class PreRecordedClient(AbstractSyncRestClient):
|
|
|
169
173
|
if isinstance(options, PrerecordedOptions):
|
|
170
174
|
self.logger.info("PrerecordedOptions switching class -> json")
|
|
171
175
|
options = options.to_json()
|
|
172
|
-
json = self.post(url, options, content=body)
|
|
176
|
+
json = self.post(url, options, content=body, timeout=timeout)
|
|
173
177
|
self.logger.info("json: %s", json)
|
|
174
178
|
res = PrerecordedResponse.from_json(json)
|
|
175
179
|
self.logger.verbose("result: %s", res)
|
|
@@ -200,6 +204,7 @@ class PreRecordedClient(AbstractSyncRestClient):
|
|
|
200
204
|
source: FileSource,
|
|
201
205
|
callback: str,
|
|
202
206
|
options: PrerecordedOptions = None,
|
|
207
|
+
timeout: httpx.Timeout = None,
|
|
203
208
|
endpoint: str = "v1/listen",
|
|
204
209
|
) -> AsyncPrerecordedResponse:
|
|
205
210
|
self.logger.debug("PreRecordedClient.transcribe_file_callback ENTER")
|
|
@@ -222,7 +227,7 @@ class PreRecordedClient(AbstractSyncRestClient):
|
|
|
222
227
|
if isinstance(options, PrerecordedOptions):
|
|
223
228
|
self.logger.info("PrerecordedOptions switching class -> json")
|
|
224
229
|
options = options.to_json()
|
|
225
|
-
json = self.post(url, options, json=body)
|
|
230
|
+
json = self.post(url, options, json=body, timeout=timeout)
|
|
226
231
|
self.logger.info("json: %s", json)
|
|
227
232
|
res = AsyncPrerecordedResponse.from_json(json)
|
|
228
233
|
self.logger.verbose("result: %s", res)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/audio/microphone/constants.py
RENAMED
|
File without changes
|
|
File without changes
|
{deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/audio/microphone/microphone.py
RENAMED
|
File without changes
|
|
File without changes
|
{deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/abstract_async_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/live/v1/async_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/manage/v1/__init__.py
RENAMED
|
File without changes
|
{deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/manage/v1/async_client.py
RENAMED
|
File without changes
|
|
File without changes
|
{deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/manage/v1/response.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/onprem/v1/__init__.py
RENAMED
|
File without changes
|
{deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/onprem/v1/async_client.py
RENAMED
|
File without changes
|
{deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/prerecorded/client.py
RENAMED
|
File without changes
|
{deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/prerecorded/errors.py
RENAMED
|
File without changes
|
{deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/prerecorded/helpers.py
RENAMED
|
File without changes
|
{deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/prerecorded/source.py
RENAMED
|
File without changes
|
{deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/prerecorded/v1/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/prerecorded/v1/options.py
RENAMED
|
File without changes
|
{deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram/clients/prerecorded/v1/response.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{deepgram-sdk-3.0.0.dev10 → deepgram-sdk-3.0.0.dev12}/deepgram_sdk.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|