most-client 1.0.4__py3-none-any.whl → 1.0.5__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.
Binary file
Binary file
Binary file
Binary file
most/api.py CHANGED
@@ -89,6 +89,8 @@ class MostClient(object):
89
89
  return self.get(url,
90
90
  headers=headers,
91
91
  **kwargs)
92
+ if resp.status_code >= 400:
93
+ raise RuntimeError(resp.json()['message'] if resp.headers.get("Content-Type") == "application/json" else "Something went wrong.")
92
94
  return resp
93
95
 
94
96
  def post(self, url,
@@ -111,6 +113,8 @@ class MostClient(object):
111
113
  json=json,
112
114
  headers=headers,
113
115
  **kwargs)
116
+ if resp.status_code >= 400:
117
+ raise RuntimeError(resp.json()['message'] if resp.headers.get("Content-Type") == "application/json" else "Something went wrong.")
114
118
  return resp
115
119
 
116
120
  def upload_audio(self, audio_path) -> Audio:
most/async_api.py CHANGED
@@ -95,6 +95,9 @@ class AsyncMostClient(object):
95
95
  return await self.get(url,
96
96
  headers=headers,
97
97
  **kwargs)
98
+ if resp.status_code >= 400:
99
+ raise RuntimeError(resp.json()['message'] if resp.headers.get(
100
+ "Content-Type") == "application/json" else "Something went wrong.")
98
101
  return resp
99
102
 
100
103
  async def post(self, url,
@@ -117,6 +120,9 @@ class AsyncMostClient(object):
117
120
  json=json,
118
121
  headers=headers,
119
122
  **kwargs)
123
+ if resp.status_code >= 400:
124
+ raise RuntimeError(resp.json()['message'] if resp.headers.get(
125
+ "Content-Type") == "application/json" else "Something went wrong.")
120
126
  return resp
121
127
 
122
128
  async def upload_audio(self, audio_path) -> Audio:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: most-client
3
- Version: 1.0.4
3
+ Version: 1.0.5
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,13 @@
1
+ most/__init__.py,sha256=62uFFeM_1VVR83K3bTYWK3PEoqnmFCy9aWYerQ6U4Ds,67
2
+ most/api.py,sha256=35SmN9BhZRUQZMH400MYh0LAHgYK8d_25at5BaBihIw,7641
3
+ most/async_api.py,sha256=QTQ2RdLeI2GzB6EvlrRnpoqs9XBOR64drVTpulvGrFI,8336
4
+ most/types.py,sha256=phMLar9VTZIVeHLBLHYsEBiTvz8af-GHHF1GLctGytE,969
5
+ most/__pycache__/__init__.cpython-310.pyc,sha256=uRCbA8tXEFLxmAlpQAF8Vdh8AZbpR52RSrGOfKRxpAQ,229
6
+ most/__pycache__/api.cpython-310.pyc,sha256=YuMpKt9DwpvUgXH2qPKMVbJxwgkTLrp9wso73MA3jkM,6582
7
+ most/__pycache__/async_api.cpython-310.pyc,sha256=d4RQJ-yhe9rbMjjU_7IyeK0lRB7WalIdXpXRxz-Db4A,7328
8
+ most/__pycache__/types.cpython-310.pyc,sha256=B3tij9LD4YJAXWiC3VHtnkVzpw5QRirrHpDMD-vekII,1861
9
+ most_client-1.0.5.dist-info/METADATA,sha256=pjYtjnQ3zfCpVEqgMCQv1Ed_t371Uwfdw1x8lmG-nHE,864
10
+ most_client-1.0.5.dist-info/WHEEL,sha256=bFJAMchF8aTQGUgMZzHJyDDMPTO3ToJ7x23SLJa1SVo,92
11
+ most_client-1.0.5.dist-info/top_level.txt,sha256=2g5fk02LKkM1hV3pVVti_LQ60TToLBcR2zQ3JEKGVk8,5
12
+ most_client-1.0.5.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
13
+ most_client-1.0.5.dist-info/RECORD,,
@@ -1,13 +0,0 @@
1
- most/__init__.py,sha256=62uFFeM_1VVR83K3bTYWK3PEoqnmFCy9aWYerQ6U4Ds,67
2
- most/api.py,sha256=8lhnJU89qMiCjYgc5Gv4Z2i782ltBA7oTtnR57WyjK8,7285
3
- most/async_api.py,sha256=tHo-vVa3a1LVCZ7c-Zwp5fmMx88AoZ3c-84VpLtlNFc,7946
4
- most/types.py,sha256=phMLar9VTZIVeHLBLHYsEBiTvz8af-GHHF1GLctGytE,969
5
- most/__pycache__/__init__.cpython-310.pyc,sha256=5RlgyJsgWSNkWEufVPFWDKxat0cEMCdwD8QFz5FvIj8,193
6
- most/__pycache__/api.cpython-310.pyc,sha256=vAmUcfJHdL-59JuzcMpDfQedBaTk62nomDuzTt-thx0,5894
7
- most/__pycache__/async_api.cpython-310.pyc,sha256=ng8wYkVziihVAMlv1ugFQQf-qFqP0NgAIfqKqE-K4k8,6615
8
- most/__pycache__/types.cpython-310.pyc,sha256=OE7jIlp_0lo6XAwsnVnbsYsjjppGzTUcVo5ve6uHnQg,1492
9
- most_client-1.0.4.dist-info/METADATA,sha256=eijnCdZFCVPNdMYgEZirZYedoNzPRJiku6Hcf8_Gvjo,864
10
- most_client-1.0.4.dist-info/WHEEL,sha256=bFJAMchF8aTQGUgMZzHJyDDMPTO3ToJ7x23SLJa1SVo,92
11
- most_client-1.0.4.dist-info/top_level.txt,sha256=2g5fk02LKkM1hV3pVVti_LQ60TToLBcR2zQ3JEKGVk8,5
12
- most_client-1.0.4.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
13
- most_client-1.0.4.dist-info/RECORD,,