most-client 1.0.9__py3-none-any.whl → 1.0.10__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.
most/api.py CHANGED
@@ -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)
most/async_api.py CHANGED
@@ -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)
most/types.py CHANGED
@@ -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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: most-client
3
- Version: 1.0.9
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
@@ -0,0 +1,9 @@
1
+ most/__init__.py,sha256=62uFFeM_1VVR83K3bTYWK3PEoqnmFCy9aWYerQ6U4Ds,67
2
+ most/api.py,sha256=tD6GkStvShdGTnjCLD34OSXLTV9mpJSQCKqo0UGsE60,9028
3
+ most/async_api.py,sha256=ixUxEttK5ibcRdWV9DghU9ixQcJWxXqdnkFEYsc6crA,9691
4
+ most/types.py,sha256=-GF8GBe0ojaAqyFl0yju030cZuUDe_6YU_5Q_5FT7UI,1565
5
+ most_client-1.0.10.dist-info/METADATA,sha256=YF8cjUF9bVgJhPg1xf-a3GNx7VPvjM9vkPgsgB5dYJk,1006
6
+ most_client-1.0.10.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
7
+ most_client-1.0.10.dist-info/top_level.txt,sha256=2g5fk02LKkM1hV3pVVti_LQ60TToLBcR2zQ3JEKGVk8,5
8
+ most_client-1.0.10.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
9
+ most_client-1.0.10.dist-info/RECORD,,
@@ -1,9 +0,0 @@
1
- most/__init__.py,sha256=62uFFeM_1VVR83K3bTYWK3PEoqnmFCy9aWYerQ6U4Ds,67
2
- most/api.py,sha256=0SP29wq9RjVJ7D5ziX0FtG8uEAU-CBOE06cqxqNT-oc,8407
3
- most/async_api.py,sha256=M8WhCagCHTooH77znMsHG98jYWJ2aPgxFx_PeKXBC-0,9016
4
- most/types.py,sha256=PZ-_yed7MnIRdygaI6aK9U6BFjWAof7JK2AgSlokXe8,1450
5
- most_client-1.0.9.dist-info/METADATA,sha256=0SAcuVnUN53VhAViD3nlUzZMHLaFL8vspXyM-mW_xBY,1005
6
- most_client-1.0.9.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
7
- most_client-1.0.9.dist-info/top_level.txt,sha256=2g5fk02LKkM1hV3pVVti_LQ60TToLBcR2zQ3JEKGVk8,5
8
- most_client-1.0.9.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
9
- most_client-1.0.9.dist-info/RECORD,,