most-client 1.0.8__tar.gz → 1.0.9__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.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: most-client
3
- Version: 1.0.8
3
+ Version: 1.0.9
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
@@ -2,7 +2,7 @@ from typing import List
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
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",
@@ -1,7 +1,7 @@
1
1
  from typing import List
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
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})
@@ -10,6 +10,12 @@ class Audio(DataClassJsonMixin):
10
10
  url: str
11
11
 
12
12
 
13
+ @dataclass_json
14
+ @dataclass
15
+ class Text(DataClassJsonMixin):
16
+ id: str
17
+
18
+
13
19
  @dataclass_json
14
20
  @dataclass
15
21
  class SubcolumnResult(DataClassJsonMixin):
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: most-client
3
- Version: 1.0.8
3
+ Version: 1.0.9
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
@@ -8,7 +8,7 @@ with open('requirements.txt', 'r') as f:
8
8
 
9
9
  setup(
10
10
  name='most-client',
11
- version='1.0.8',
11
+ version='1.0.9',
12
12
  python_requires=f'>=3.6',
13
13
  description='Most AI API for https://the-most.ai',
14
14
  url='https://github.com/the-most-ai/most-client',
File without changes
File without changes
File without changes