most-client 1.0.9__tar.gz → 1.0.10__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.9/most_client.egg-info → most_client-1.0.10}/PKG-INFO +1 -1
- {most_client-1.0.9 → most_client-1.0.10}/README.md +6 -0
- {most_client-1.0.9 → most_client-1.0.10}/most/api.py +15 -2
- {most_client-1.0.9 → most_client-1.0.10}/most/async_api.py +15 -2
- {most_client-1.0.9 → most_client-1.0.10}/most/types.py +8 -1
- {most_client-1.0.9 → most_client-1.0.10/most_client.egg-info}/PKG-INFO +1 -1
- {most_client-1.0.9 → most_client-1.0.10}/setup.py +1 -1
- {most_client-1.0.9 → most_client-1.0.10}/MANIFEST.in +0 -0
- {most_client-1.0.9 → most_client-1.0.10}/most/__init__.py +0 -0
- {most_client-1.0.9 → most_client-1.0.10}/most_client.egg-info/SOURCES.txt +0 -0
- {most_client-1.0.9 → most_client-1.0.10}/most_client.egg-info/dependency_links.txt +0 -0
- {most_client-1.0.9 → most_client-1.0.10}/most_client.egg-info/requires.txt +0 -0
- {most_client-1.0.9 → most_client-1.0.10}/most_client.egg-info/top_level.txt +0 -0
- {most_client-1.0.9 → most_client-1.0.10}/most_client.egg-info/zip-safe +0 -0
- {most_client-1.0.9 → most_client-1.0.10}/requirements.txt +0 -0
- {most_client-1.0.9 → most_client-1.0.10}/setup.cfg +0 -0
@@ -1,8 +1,8 @@
|
|
1
|
-
from typing import List
|
1
|
+
from typing import List, Dict
|
2
2
|
import json5
|
3
3
|
import requests
|
4
4
|
from adaptix import Retort
|
5
|
-
from most.types import Audio, Result, Script, JobStatus, Text
|
5
|
+
from most.types import Audio, Result, Script, JobStatus, Text, StoredAudioData
|
6
6
|
from pathlib import Path
|
7
7
|
|
8
8
|
|
@@ -194,6 +194,19 @@ class MostClient(object):
|
|
194
194
|
params={'audio_ids': ','.join(audio_ids)})
|
195
195
|
return resp.url
|
196
196
|
|
197
|
+
def store_info(self,
|
198
|
+
audio_id: str,
|
199
|
+
data: Dict[str, str]):
|
200
|
+
resp = self.post(f"https://api.the-most.ai/api/external/{self.client_id}/audio/{audio_id}/info",
|
201
|
+
json={
|
202
|
+
"data": data,
|
203
|
+
})
|
204
|
+
return self.retort.load(resp.json(), StoredAudioData)
|
205
|
+
|
206
|
+
def fetch_info(self, audio_id: str) -> Dict[str, str]:
|
207
|
+
resp = self.get(f"https://api.the-most.ai/api/external/{self.client_id}/audio/{audio_id}/info")
|
208
|
+
return self.retort.load(resp.json(), StoredAudioData)
|
209
|
+
|
197
210
|
def __call__(self, audio_path: Path):
|
198
211
|
audio = self.upload_audio(audio_path)
|
199
212
|
return self.apply(audio.id)
|
@@ -1,7 +1,7 @@
|
|
1
|
-
from typing import List
|
1
|
+
from typing import List, Dict
|
2
2
|
import json5
|
3
3
|
from adaptix import Retort
|
4
|
-
from most.types import Audio, Result, Script, JobStatus, Text
|
4
|
+
from most.types import Audio, Result, Script, JobStatus, Text, StoredAudioData
|
5
5
|
from pathlib import Path
|
6
6
|
import httpx
|
7
7
|
|
@@ -201,6 +201,19 @@ class AsyncMostClient(object):
|
|
201
201
|
params={'audio_ids': ','.join(audio_ids)})
|
202
202
|
return resp.next_request.url
|
203
203
|
|
204
|
+
async def store_info(self,
|
205
|
+
audio_id: str,
|
206
|
+
data: Dict[str, str]):
|
207
|
+
resp = await self.post(f"https://api.the-most.ai/api/external/{self.client_id}/audio/{audio_id}/info",
|
208
|
+
json={
|
209
|
+
"data": data,
|
210
|
+
})
|
211
|
+
return self.retort.load(resp.json(), StoredAudioData)
|
212
|
+
|
213
|
+
async def fetch_info(self, audio_id: str) -> Dict[str, str]:
|
214
|
+
resp = await self.get(f"https://api.the-most.ai/api/external/{self.client_id}/audio/{audio_id}/info")
|
215
|
+
return self.retort.load(resp.json(), StoredAudioData)
|
216
|
+
|
204
217
|
async def __call__(self, audio_path: Path):
|
205
218
|
audio = await self.upload_audio(audio_path)
|
206
219
|
return await self.apply(audio.id)
|
@@ -1,6 +1,13 @@
|
|
1
1
|
from dataclasses import dataclass
|
2
2
|
from dataclasses_json import dataclass_json, DataClassJsonMixin
|
3
|
-
from typing import Optional, List, Literal
|
3
|
+
from typing import Optional, List, Literal, Dict
|
4
|
+
|
5
|
+
|
6
|
+
@dataclass_json
|
7
|
+
@dataclass
|
8
|
+
class StoredAudioData(DataClassJsonMixin):
|
9
|
+
id: str
|
10
|
+
data: Dict[str, str]
|
4
11
|
|
5
12
|
|
6
13
|
@dataclass_json
|
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
|