most-client 1.0.45__py3-none-any.whl → 1.0.46__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
@@ -470,3 +470,20 @@ class MostClient(object):
470
470
  'end_dt': end_dt.astimezone(timezone.utc).isoformat()})
471
471
  resp.raise_for_status()
472
472
  return self.retort.load(resp.json(), Usage)
473
+
474
+ def ask(self, question,
475
+ audio_ids: List[str],
476
+ text_ids: List[str]) -> str:
477
+ if not all(is_valid_id(text_id) for text_id in text_ids):
478
+ raise RuntimeError("Please use valid text_id. [try text.id from list_texts()]")
479
+
480
+ if not all(is_valid_id(audio_id) for audio_id in audio_ids):
481
+ raise RuntimeError("Please use valid text_id. [try text.id from list_texts()]")
482
+
483
+ resp = self.post(f"/{self.client_id}/model/{self.model_id}/ask",
484
+ json={
485
+ "question": question,
486
+ "text_ids": text_ids,
487
+ "audio_ids": audio_ids,
488
+ })
489
+ return resp.json()
most/async_api.py CHANGED
@@ -478,3 +478,20 @@ class AsyncMostClient(object):
478
478
  'end_dt': end_dt.astimezone(timezone.utc).isoformat()})
479
479
  resp.raise_for_status()
480
480
  return self.retort.load(resp.json(), Usage)
481
+
482
+ async def ask(self, question,
483
+ audio_ids: List[str],
484
+ text_ids: List[str]) -> str:
485
+ if not all(is_valid_id(text_id) for text_id in text_ids):
486
+ raise RuntimeError("Please use valid text_id. [try text.id from list_texts()]")
487
+
488
+ if not all(is_valid_id(audio_id) for audio_id in audio_ids):
489
+ raise RuntimeError("Please use valid text_id. [try text.id from list_texts()]")
490
+
491
+ resp = await self.post(f"/{self.client_id}/model/{self.model_id}/ask",
492
+ json={
493
+ "question": question,
494
+ "text_ids": text_ids,
495
+ "audio_ids": audio_ids,
496
+ })
497
+ return resp.json()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: most-client
3
- Version: 1.0.45
3
+ Version: 1.0.46
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
@@ -1,7 +1,7 @@
1
1
  most/__init__.py,sha256=ZA2n_h824tfGd5tFl3RsD0noUyv_T08fBoBxMEgxmzs,548
2
2
  most/_constrants.py,sha256=SlHKcBoXwe_sPzk8tdbb7lqhQz-Bfo__FhSoeFWodZE,217
3
- most/api.py,sha256=oD7VmdxdoyQI05ISgVvOG1o6dlW97FLohLhmXyD5h4k,19773
4
- most/async_api.py,sha256=vg0Y-EOEMNxPOae9rIXxD4AeEvTwTEjpP_6Vzht2AZw,21092
3
+ most/api.py,sha256=EeK7_uPcJ2QI2FD_l11RIpgi8C-JGSe2G7AwKK9iqXY,20513
4
+ most/async_api.py,sha256=3hWDH-twIeivb5md8KBuBjoZFTiV92PxDRdIYJ-8eKo,21886
5
5
  most/async_catalog.py,sha256=LgQ5zghQtDMnqq-WjmRHqZkqcdixZnHtmoRaVv74VKM,1059
6
6
  most/async_glossary.py,sha256=nehgkQvqENxT5vnmMiRLSWgD0jFr2Hzs7yqNZfC9ahs,1281
7
7
  most/async_searcher.py,sha256=C0zViW20K7OhKO1BzBZktTbMJYBBvor3uK6LAHZTxz0,2238
@@ -13,8 +13,8 @@ most/search_types.py,sha256=GFwXaDJV4qI_gaFZToLMHoYH-JXVfIVwfVTgJ7RDWoY,7211
13
13
  most/searcher.py,sha256=9UdiSlScsE6EPc6RpK8xkRLeB5gHNxgPQpXTJ17i3lQ,2135
14
14
  most/trainer_api.py,sha256=ZwOv4mhROfY97n6i7IY_ZpafsuNRazOqMBAf2dh708k,992
15
15
  most/types.py,sha256=7o8uqhQd8FbO7H50TMJPbSIG4VyyX-LumWYRlHeqwgg,5343
16
- most_client-1.0.45.dist-info/METADATA,sha256=adEOomfAq7CaqdscKedIhXOLxCKDl7nSX8aNAA9Icrw,1027
17
- most_client-1.0.45.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
18
- most_client-1.0.45.dist-info/top_level.txt,sha256=2g5fk02LKkM1hV3pVVti_LQ60TToLBcR2zQ3JEKGVk8,5
19
- most_client-1.0.45.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
20
- most_client-1.0.45.dist-info/RECORD,,
16
+ most_client-1.0.46.dist-info/METADATA,sha256=jJop33nFt004MEkWb6cEuS6lcYNwuamZsAr3qworCO0,1027
17
+ most_client-1.0.46.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
18
+ most_client-1.0.46.dist-info/top_level.txt,sha256=2g5fk02LKkM1hV3pVVti_LQ60TToLBcR2zQ3JEKGVk8,5
19
+ most_client-1.0.46.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
20
+ most_client-1.0.46.dist-info/RECORD,,