most-client 1.0.21__tar.gz → 1.0.23__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.
- {most_client-1.0.21/most_client.egg-info → most_client-1.0.23}/PKG-INFO +1 -1
- {most_client-1.0.21 → most_client-1.0.23}/most/api.py +41 -1
- {most_client-1.0.21 → most_client-1.0.23}/most/async_api.py +41 -1
- {most_client-1.0.21 → most_client-1.0.23/most_client.egg-info}/PKG-INFO +1 -1
- {most_client-1.0.21 → most_client-1.0.23}/setup.py +1 -1
- {most_client-1.0.21 → most_client-1.0.23}/MANIFEST.in +0 -0
- {most_client-1.0.21 → most_client-1.0.23}/README.md +0 -0
- {most_client-1.0.21 → most_client-1.0.23}/most/__init__.py +0 -0
- {most_client-1.0.21 → most_client-1.0.23}/most/score_calculation.py +0 -0
- {most_client-1.0.21 → most_client-1.0.23}/most/types.py +0 -0
- {most_client-1.0.21 → most_client-1.0.23}/most_client.egg-info/SOURCES.txt +0 -0
- {most_client-1.0.21 → most_client-1.0.23}/most_client.egg-info/dependency_links.txt +0 -0
- {most_client-1.0.21 → most_client-1.0.23}/most_client.egg-info/requires.txt +0 -0
- {most_client-1.0.21 → most_client-1.0.23}/most_client.egg-info/top_level.txt +0 -0
- {most_client-1.0.21 → most_client-1.0.23}/most_client.egg-info/zip-safe +0 -0
- {most_client-1.0.21 → most_client-1.0.23}/requirements.txt +0 -0
- {most_client-1.0.21 → most_client-1.0.23}/setup.cfg +0 -0
@@ -18,7 +18,7 @@ from most.types import (
|
|
18
18
|
Script,
|
19
19
|
StoredAudioData,
|
20
20
|
Text,
|
21
|
-
is_valid_id, SearchParams, ScriptScoreMapping,
|
21
|
+
is_valid_id, SearchParams, ScriptScoreMapping, Dialog,
|
22
22
|
)
|
23
23
|
|
24
24
|
|
@@ -144,6 +144,11 @@ class MostClient(object):
|
|
144
144
|
files={"text": text})
|
145
145
|
return self.retort.load(resp.json(), Text)
|
146
146
|
|
147
|
+
def upload_dialog(self, dialog: Dialog) -> DialogResult:
|
148
|
+
resp = self.post(f"https://api.the-most.ai/api/external/{self.client_id}/upload_dialog",
|
149
|
+
json={"dialog": dialog})
|
150
|
+
return self.retort.load(resp.json(), DialogResult)
|
151
|
+
|
147
152
|
def upload_audio(self, audio_path) -> Audio:
|
148
153
|
with open(audio_path, 'rb') as f:
|
149
154
|
resp = self.post(f"https://api.the-most.ai/api/external/{self.client_id}/upload",
|
@@ -173,6 +178,13 @@ class MostClient(object):
|
|
173
178
|
audio_list = resp.json()
|
174
179
|
return self.retort.load(audio_list, List[Audio])
|
175
180
|
|
181
|
+
def list_texts(self,
|
182
|
+
offset: int = 0,
|
183
|
+
limit: int = 10) -> List[Text]:
|
184
|
+
resp = self.get(f"https://api.the-most.ai/api/external/{self.client_id}/list_texts?offset={offset}&limit={limit}")
|
185
|
+
texts_list = resp.json()
|
186
|
+
return self.retort.load(texts_list, List[Text])
|
187
|
+
|
176
188
|
def get_model_script(self) -> Script:
|
177
189
|
if not is_valid_id(self.model_id):
|
178
190
|
raise RuntimeError("Please choose valid model to apply. [try list_models()]")
|
@@ -209,6 +221,20 @@ class MostClient(object):
|
|
209
221
|
result = self.score_modifier.modify(result)
|
210
222
|
return result
|
211
223
|
|
224
|
+
def apply_on_text(self, text_id,
|
225
|
+
modify_scores: bool = False) -> Result:
|
226
|
+
if not is_valid_id(self.model_id):
|
227
|
+
raise RuntimeError("Please choose valid model to apply. [try list_models()]")
|
228
|
+
|
229
|
+
if not is_valid_id(text_id):
|
230
|
+
raise RuntimeError("Please use valid text_id. [try text.id from list_texts()]")
|
231
|
+
|
232
|
+
resp = self.post(f"https://api.the-most.ai/api/external/{self.client_id}/text/{text_id}/model/{self.model_id}/apply")
|
233
|
+
result = self.retort.load(resp.json(), Result)
|
234
|
+
if modify_scores:
|
235
|
+
result = self.score_modifier.modify(result)
|
236
|
+
return result
|
237
|
+
|
212
238
|
def apply_later(self, audio_id,
|
213
239
|
modify_scores: bool = False) -> Result:
|
214
240
|
if not is_valid_id(self.model_id):
|
@@ -223,6 +249,20 @@ class MostClient(object):
|
|
223
249
|
result = self.score_modifier.modify(result)
|
224
250
|
return result
|
225
251
|
|
252
|
+
def apply_on_text_later(self, text_id,
|
253
|
+
modify_scores: bool = False) -> Result:
|
254
|
+
if not is_valid_id(self.model_id):
|
255
|
+
raise RuntimeError("Please choose valid model to apply. [try list_models()]")
|
256
|
+
|
257
|
+
if not is_valid_id(text_id):
|
258
|
+
raise RuntimeError("Please use valid text_id. [try audio.id from list_texts()]")
|
259
|
+
|
260
|
+
resp = self.post(f"https://api.the-most.ai/api/external/{self.client_id}/text/{text_id}/model/{self.model_id}/apply_async")
|
261
|
+
result = self.retort.load(resp.json(), Result)
|
262
|
+
if modify_scores:
|
263
|
+
result = self.score_modifier.modify(result)
|
264
|
+
return result
|
265
|
+
|
226
266
|
def get_job_status(self, audio_id) -> JobStatus:
|
227
267
|
if not is_valid_id(self.model_id):
|
228
268
|
raise RuntimeError("Please choose valid model to apply. [try list_models()]")
|
@@ -18,7 +18,7 @@ from most.types import (
|
|
18
18
|
Script,
|
19
19
|
StoredAudioData,
|
20
20
|
Text,
|
21
|
-
is_valid_id, SearchParams, ScriptScoreMapping,
|
21
|
+
is_valid_id, SearchParams, ScriptScoreMapping, Dialog,
|
22
22
|
)
|
23
23
|
|
24
24
|
|
@@ -170,6 +170,11 @@ class AsyncMostClient(object):
|
|
170
170
|
json={"text": text})
|
171
171
|
return self.retort.load(resp.json(), Text)
|
172
172
|
|
173
|
+
async def upload_dialog(self, dialog: Dialog) -> DialogResult:
|
174
|
+
resp = await self.post(f"https://api.the-most.ai/api/external/{self.client_id}/upload_dialog",
|
175
|
+
json={"dialog": dialog})
|
176
|
+
return self.retort.load(resp.json(), DialogResult)
|
177
|
+
|
173
178
|
async def upload_audio_url(self, audio_url) -> Audio:
|
174
179
|
resp = await self.post(f"https://api.the-most.ai/api/external/{self.client_id}/upload_url",
|
175
180
|
json={"audio_url": audio_url})
|
@@ -182,6 +187,13 @@ class AsyncMostClient(object):
|
|
182
187
|
audio_list = resp.json()
|
183
188
|
return self.retort.load(audio_list, List[Audio])
|
184
189
|
|
190
|
+
async def list_texts(self,
|
191
|
+
offset: int = 0,
|
192
|
+
limit: int = 10) -> List[Text]:
|
193
|
+
resp = await self.get(f"https://api.the-most.ai/api/external/{self.client_id}/list_texts?offset={offset}&limit={limit}")
|
194
|
+
texts_list = resp.json()
|
195
|
+
return self.retort.load(texts_list, List[Text])
|
196
|
+
|
185
197
|
async def get_model_script(self) -> Script:
|
186
198
|
if not is_valid_id(self.model_id):
|
187
199
|
raise RuntimeError("Please choose valid model to apply. [try list_models()]")
|
@@ -218,6 +230,20 @@ class AsyncMostClient(object):
|
|
218
230
|
result = self.score_modifier.modify(result)
|
219
231
|
return result
|
220
232
|
|
233
|
+
async def apply_on_text(self, text_id,
|
234
|
+
modify_scores: bool = False) -> Result:
|
235
|
+
if not is_valid_id(self.model_id):
|
236
|
+
raise RuntimeError("Please choose valid model to apply. [try list_models()]")
|
237
|
+
|
238
|
+
if not is_valid_id(text_id):
|
239
|
+
raise RuntimeError("Please use valid text_id. [try text.id from list_texts()]")
|
240
|
+
|
241
|
+
resp = await self.post(f"https://api.the-most.ai/api/external/{self.client_id}/text/{text_id}/model/{self.model_id}/apply")
|
242
|
+
result = self.retort.load(resp.json(), Result)
|
243
|
+
if modify_scores:
|
244
|
+
result = self.score_modifier.modify(result)
|
245
|
+
return result
|
246
|
+
|
221
247
|
async def apply_later(self, audio_id,
|
222
248
|
modify_scores: bool = False) -> Result:
|
223
249
|
if not is_valid_id(self.model_id):
|
@@ -232,6 +258,20 @@ class AsyncMostClient(object):
|
|
232
258
|
result = self.score_modifier.modify(result)
|
233
259
|
return result
|
234
260
|
|
261
|
+
async def apply_on_text_later(self, text_id,
|
262
|
+
modify_scores: bool = False) -> Result:
|
263
|
+
if not is_valid_id(self.model_id):
|
264
|
+
raise RuntimeError("Please choose valid model to apply. [try list_models()]")
|
265
|
+
|
266
|
+
if not is_valid_id(text_id):
|
267
|
+
raise RuntimeError("Please use valid text_id. [try audio.id from list_texts()]")
|
268
|
+
|
269
|
+
resp = await self.post(f"https://api.the-most.ai/api/external/{self.client_id}/text/{text_id}/model/{self.model_id}/apply_async")
|
270
|
+
result = self.retort.load(resp.json(), Result)
|
271
|
+
if modify_scores:
|
272
|
+
result = self.score_modifier.modify(result)
|
273
|
+
return result
|
274
|
+
|
235
275
|
async def get_job_status(self, audio_id) -> JobStatus:
|
236
276
|
if not is_valid_id(self.model_id):
|
237
277
|
raise RuntimeError("Please choose valid model to apply. [try list_models()]")
|
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
|
File without changes
|
File without changes
|
File without changes
|