most-client 1.0.45__tar.gz → 1.0.46__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.
Files changed (27) hide show
  1. {most_client-1.0.45/most_client.egg-info → most_client-1.0.46}/PKG-INFO +1 -1
  2. {most_client-1.0.45 → most_client-1.0.46}/most/api.py +17 -0
  3. {most_client-1.0.45 → most_client-1.0.46}/most/async_api.py +17 -0
  4. {most_client-1.0.45 → most_client-1.0.46/most_client.egg-info}/PKG-INFO +1 -1
  5. {most_client-1.0.45 → most_client-1.0.46}/setup.py +1 -1
  6. {most_client-1.0.45 → most_client-1.0.46}/MANIFEST.in +0 -0
  7. {most_client-1.0.45 → most_client-1.0.46}/README.md +0 -0
  8. {most_client-1.0.45 → most_client-1.0.46}/most/__init__.py +0 -0
  9. {most_client-1.0.45 → most_client-1.0.46}/most/_constrants.py +0 -0
  10. {most_client-1.0.45 → most_client-1.0.46}/most/async_catalog.py +0 -0
  11. {most_client-1.0.45 → most_client-1.0.46}/most/async_glossary.py +0 -0
  12. {most_client-1.0.45 → most_client-1.0.46}/most/async_searcher.py +0 -0
  13. {most_client-1.0.45 → most_client-1.0.46}/most/async_trainer_api.py +0 -0
  14. {most_client-1.0.45 → most_client-1.0.46}/most/catalog.py +0 -0
  15. {most_client-1.0.45 → most_client-1.0.46}/most/glossary.py +0 -0
  16. {most_client-1.0.45 → most_client-1.0.46}/most/score_calculation.py +0 -0
  17. {most_client-1.0.45 → most_client-1.0.46}/most/search_types.py +0 -0
  18. {most_client-1.0.45 → most_client-1.0.46}/most/searcher.py +0 -0
  19. {most_client-1.0.45 → most_client-1.0.46}/most/trainer_api.py +0 -0
  20. {most_client-1.0.45 → most_client-1.0.46}/most/types.py +0 -0
  21. {most_client-1.0.45 → most_client-1.0.46}/most_client.egg-info/SOURCES.txt +0 -0
  22. {most_client-1.0.45 → most_client-1.0.46}/most_client.egg-info/dependency_links.txt +0 -0
  23. {most_client-1.0.45 → most_client-1.0.46}/most_client.egg-info/requires.txt +0 -0
  24. {most_client-1.0.45 → most_client-1.0.46}/most_client.egg-info/top_level.txt +0 -0
  25. {most_client-1.0.45 → most_client-1.0.46}/most_client.egg-info/zip-safe +0 -0
  26. {most_client-1.0.45 → most_client-1.0.46}/requirements.txt +0 -0
  27. {most_client-1.0.45 → most_client-1.0.46}/setup.cfg +0 -0
@@ -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
@@ -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()
@@ -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
@@ -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.45',
11
+ version='1.0.46',
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
File without changes