most-client 1.0.8__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.8/most_client.egg-info → most_client-1.0.10}/PKG-INFO +9 -2
- {most_client-1.0.8 → most_client-1.0.10}/README.md +6 -0
- {most_client-1.0.8 → most_client-1.0.10}/most/api.py +20 -2
- {most_client-1.0.8 → most_client-1.0.10}/most/async_api.py +20 -2
- {most_client-1.0.8 → most_client-1.0.10}/most/types.py +14 -1
- {most_client-1.0.8 → most_client-1.0.10/most_client.egg-info}/PKG-INFO +9 -2
- {most_client-1.0.8 → most_client-1.0.10}/setup.py +1 -1
- {most_client-1.0.8 → most_client-1.0.10}/MANIFEST.in +0 -0
- {most_client-1.0.8 → most_client-1.0.10}/most/__init__.py +0 -0
- {most_client-1.0.8 → most_client-1.0.10}/most_client.egg-info/SOURCES.txt +0 -0
- {most_client-1.0.8 → most_client-1.0.10}/most_client.egg-info/dependency_links.txt +0 -0
- {most_client-1.0.8 → most_client-1.0.10}/most_client.egg-info/requires.txt +0 -0
- {most_client-1.0.8 → most_client-1.0.10}/most_client.egg-info/top_level.txt +0 -0
- {most_client-1.0.8 → most_client-1.0.10}/most_client.egg-info/zip-safe +0 -0
- {most_client-1.0.8 → most_client-1.0.10}/requirements.txt +0 -0
- {most_client-1.0.8 → most_client-1.0.10}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.2
|
2
2
|
Name: most-client
|
3
|
-
Version: 1.0.
|
3
|
+
Version: 1.0.10
|
4
4
|
Summary: Most AI API for https://the-most.ai
|
5
5
|
Home-page: https://github.com/the-most-ai/most-client
|
6
6
|
Author: George Kasparyants
|
@@ -26,3 +26,10 @@ Requires-Dist: pytest
|
|
26
26
|
Requires-Dist: tox
|
27
27
|
Requires-Dist: twine
|
28
28
|
Requires-Dist: httpx
|
29
|
+
Dynamic: author
|
30
|
+
Dynamic: author-email
|
31
|
+
Dynamic: classifier
|
32
|
+
Dynamic: home-page
|
33
|
+
Dynamic: requires-dist
|
34
|
+
Dynamic: requires-python
|
35
|
+
Dynamic: summary
|
@@ -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
|
5
|
+
from most.types import Audio, Result, Script, JobStatus, Text, StoredAudioData
|
6
6
|
from pathlib import Path
|
7
7
|
|
8
8
|
|
@@ -120,6 +120,11 @@ class MostClient(object):
|
|
120
120
|
raise RuntimeError(resp.json()['message'] if resp.headers.get("Content-Type") == "application/json" else "Something went wrong.")
|
121
121
|
return resp
|
122
122
|
|
123
|
+
def upload_text(self, text: str) -> Text:
|
124
|
+
resp = self.post(f"https://api.the-most.ai/api/external/{self.client_id}/upload_text",
|
125
|
+
files={"text": text})
|
126
|
+
return self.retort.load(resp.json(), Text)
|
127
|
+
|
123
128
|
def upload_audio(self, audio_path) -> Audio:
|
124
129
|
with open(audio_path, 'rb') as f:
|
125
130
|
resp = self.post(f"https://api.the-most.ai/api/external/{self.client_id}/upload",
|
@@ -189,6 +194,19 @@ class MostClient(object):
|
|
189
194
|
params={'audio_ids': ','.join(audio_ids)})
|
190
195
|
return resp.url
|
191
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
|
+
|
192
210
|
def __call__(self, audio_path: Path):
|
193
211
|
audio = self.upload_audio(audio_path)
|
194
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
|
4
|
+
from most.types import Audio, Result, Script, JobStatus, Text, StoredAudioData
|
5
5
|
from pathlib import Path
|
6
6
|
import httpx
|
7
7
|
|
@@ -133,6 +133,11 @@ class AsyncMostClient(object):
|
|
133
133
|
files={"audio_file": f})
|
134
134
|
return self.retort.load(resp.json(), Audio)
|
135
135
|
|
136
|
+
async def upload_text(self, text: str) -> Text:
|
137
|
+
resp = await self.post(f"https://api.the-most.ai/api/external/{self.client_id}/upload_text",
|
138
|
+
json={"text": text})
|
139
|
+
return self.retort.load(resp.json(), Text)
|
140
|
+
|
136
141
|
async def upload_audio_url(self, audio_url) -> Audio:
|
137
142
|
resp = await self.post(f"https://api.the-most.ai/api/external/{self.client_id}/upload_url",
|
138
143
|
json={"audio_url": audio_url})
|
@@ -196,6 +201,19 @@ class AsyncMostClient(object):
|
|
196
201
|
params={'audio_ids': ','.join(audio_ids)})
|
197
202
|
return resp.next_request.url
|
198
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
|
+
|
199
217
|
async def __call__(self, audio_path: Path):
|
200
218
|
audio = await self.upload_audio(audio_path)
|
201
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
|
@@ -10,6 +17,12 @@ class Audio(DataClassJsonMixin):
|
|
10
17
|
url: str
|
11
18
|
|
12
19
|
|
20
|
+
@dataclass_json
|
21
|
+
@dataclass
|
22
|
+
class Text(DataClassJsonMixin):
|
23
|
+
id: str
|
24
|
+
|
25
|
+
|
13
26
|
@dataclass_json
|
14
27
|
@dataclass
|
15
28
|
class SubcolumnResult(DataClassJsonMixin):
|
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.2
|
2
2
|
Name: most-client
|
3
|
-
Version: 1.0.
|
3
|
+
Version: 1.0.10
|
4
4
|
Summary: Most AI API for https://the-most.ai
|
5
5
|
Home-page: https://github.com/the-most-ai/most-client
|
6
6
|
Author: George Kasparyants
|
@@ -26,3 +26,10 @@ Requires-Dist: pytest
|
|
26
26
|
Requires-Dist: tox
|
27
27
|
Requires-Dist: twine
|
28
28
|
Requires-Dist: httpx
|
29
|
+
Dynamic: author
|
30
|
+
Dynamic: author-email
|
31
|
+
Dynamic: classifier
|
32
|
+
Dynamic: home-page
|
33
|
+
Dynamic: requires-dist
|
34
|
+
Dynamic: requires-python
|
35
|
+
Dynamic: summary
|
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
|