Skip to content

Commit ea8bef9

Browse files
Features on model client (#2)
* add support link * Update features list with links to documentation * Generate documentation with sphinx * Update model calls to get models by name Update samples to get models by id Update tests * docs: removed github pages links * fix: remove docs folder * fix: model sample name * feat: add TIMEOUT status, fix block function
1 parent d029f8d commit ea8bef9

26 files changed

+328
-844
lines changed

CONTRIBUTING.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,4 +185,4 @@ Push your branch to GitHub:
185185
== Support
186186

187187
Use GitHub to report bugs and send feature requests. +
188-
Reach out to ....... for support requests.
188+
Reach out to https://www.modzy.com/support/ for support requests.

README.adoc

+137-8
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,19 @@ client = ApiClient(base_url='https://modzy.example.com/api', api_key='my_key.mod
103103

104104
=== Basic usage
105105

106+
The code below is applicable for `text/plain` input type.
107+
108+
109+
++++
110+
<div align="center">
111+
112+
<img src="python.gif" alt="basic usage" style="max-width:100%">
113+
114+
</div>
115+
116+
<br>
117+
++++
118+
106119
Submit a job providing the model, version, and input file:
107120

108121
[source, py]
@@ -191,29 +204,145 @@ results_json = outputs['results.json']
191204
print(results_json)
192205
----
193206

207+
== Features
208+
209+
Currently we support the following api routes:
210+
211+
:doc-pages: https://models.modzy.com/docs/
212+
[cols=3*, stripes=even]
213+
|===
214+
|Feature|Code|Api route
215+
216+
|[small]#Retrieve all models#
217+
|[small]#client.models.get_all()#
218+
|[small]#link:{doc-pages}api-reference/marketplace/retrieve-models[api/models]#
219+
220+
|[small]#Retrieve some models#
221+
|[small]#client.models.get_models()#
222+
|[small]#link:{doc-pages}api-reference/marketplace/retrieve-models[api/models]#
223+
224+
|[small]#Retrieve model details#
225+
|[small]#client.models.get()#
226+
|[small]#link:{doc-pages}api-reference/marketplace/retrieve-model-details[api/models/:model-id]#
227+
228+
|[small]#Retrieve model by name#
229+
|[small]#client.models.get_by_name()#
230+
|[small]#link:{doc-pages}api-reference/marketplace/retrieve-models[api/models]#
231+
232+
|[small]#Retrieve related models#
233+
|[small]#client.models.get_related()#
234+
|[small]#link:{doc-pages}api-reference/marketplace/retrieve-related-models[api/models/:model-id/related-models]#
235+
236+
|[small]#Retrieve model versions#
237+
|[small]#client.models.get_versions()#
238+
|[small]#link:{doc-pages}api-reference/marketplace/retrieve-versions[api/models/:model-id/versions]#
239+
240+
|[small]#Retrieve model version details#
241+
|[small]#client.models.get_version()#
242+
|[small]#link:{doc-pages}api-reference/marketplace/retrieve-version-details[api/models/:model-id/versions/:version-id]#
243+
244+
|[small]#Retrieve all tags#
245+
|[small]#client.tags.get_all()#
246+
|[small]#link:{doc-pages}api-reference/marketplace/retrieve-tags[api/models/tags]#
247+
248+
|[small]#Retrieve Tags and Models#
249+
|[small]#client.tags.get_tags_and_models()#
250+
|[small]#link:{doc-pages}api-reference/marketplace/retrieve-models-by-tags[api/models/tags/:tag-id]#
251+
252+
|[small]#Submit a Job (Single Text)#
253+
|[small]#client.jobs.submit_text()#
254+
|[small]#link:{doc-pages}api-reference/job-inputs/submit-job[api/jobs]#
255+
256+
|[small]#Submit a Job (Multiple Text)#
257+
|[small]#client.jobs.submit_text_bulk()#
258+
|[small]#link:{doc-pages}api-reference/job-inputs/submit-job[api/jobs]#
259+
260+
|[small]#Submit a Job (Single Embedded)#
261+
|[small]#client.jobs.submit_bytes()#
262+
|[small]#link:{doc-pages}api-reference/job-inputs/submit-job[api/jobs]#
263+
264+
|[small]#Submit a Job (Multiple Embedded)#
265+
|[small]#client.jobs.submit_bytes_bulk()#
266+
|[small]#link:{doc-pages}api-reference/job-inputs/submit-job[api/jobs]#
267+
268+
|[small]#Submit a Job (Single File)#
269+
|[small]#client.jobs.submit_files()#
270+
|[small]#link:{doc-pages}api-reference/job-inputs/submit-job[api/jobs]#
271+
272+
|[small]#Submit a Job (Multiple Files)#
273+
|[small]#client.jobs.submit_files_bulk()#
274+
|[small]#link:{doc-pages}api-reference/job-inputs/submit-job[api/jobs]#
275+
276+
|[small]#Submit a Job (Single AWS S3)#
277+
|[small]#client.jobs.submit_aws_s3()#
278+
|[small]#link:{doc-pages}api-reference/job-inputs/submit-job[api/jobs]#
279+
280+
|[small]#Submit a Job (Multiple AWS S3)#
281+
|[small]#client.jobs.submit_aws_s3_bulk()#
282+
|[small]#link:{doc-pages}api-reference/job-inputs/submit-job[api/jobs]#
283+
284+
|[small]#Submit a Job (JDBC)#
285+
|[small]#client.jobs.submit_jdbc()#
286+
|[small]#link:{doc-pages}api-reference/job-inputs/submit-job[api/jobs]#
287+
288+
|[small]#Cancel job#
289+
|[small]#job.cancel()#
290+
|[small]#link:{doc-pages}api-reference/jobs/cancel-pending-job[api/jobs/:job-id]#
291+
292+
|[small]#Hold until inference is complete#
293+
|[small]#job.block_until_complete()#
294+
|[small]#link:{doc-pages}api-reference/job-inputs/submit-job[api/jobs]#
295+
296+
|[small]#Get Job details#
297+
|[small]#client.jobs.get()#
298+
|[small]#link:{doc-pages}api-reference/jobs/retrieve-job-details[api/jobs/:job-id]#
299+
300+
|[small]#Retrieve results#
301+
|[small]#job.get_result()#
302+
|[small]#link:{doc-pages}api-reference/jobs/cancel-pending-job[api/jobs/:job-id]#
303+
304+
|[small]#Retrieve Job History#
305+
|[small]#client.jobs.get_history()#
306+
|[small]#link:{doc-pages}api-reference/jobs/retrieve-job-history[api/jobs/history]#
307+
308+
|===
194309

195310
== Samples
196311

312+
313+
197314
++++
198315
<p>Check out our <a href=/samples style="text-decoration:none">samples</a> for details on specific use cases.
199316
</p>
200317
++++
201318

319+
Set the base url and api key in each sample file:
320+
321+
[source, python]
322+
----
323+
# TODO: set the base url of modzy api and you api key
324+
client = ApiClient(base_url=BASE_URL, api_key=API_KEY)
325+
----
326+
++++
327+
<p>Or follow the instructions <a href="/contributing.adoc#set-environment-variables-in-bash" style="text-decoration:none">here</a> to learn more.
328+
</p>
329+
++++
330+
331+
And then, you can:
332+
333+
[source, bash]
334+
----
335+
`$ py samples/job_with_text_input_sample.py`
336+
----
337+
338+
202339
== Contributing
203340

204341
++++
205342
<p>We are happy to receive contributions from all of our users. Check out our <a href="/CONTRIBUTING.adoc" style="text-decoration:none">contributing file</a> to learn more.
206343
</p>
207344
++++
208345

209-
// === To do
210-
// - Documentation improvement
211-
// - Comprehensive unit tests
212-
// - Wider API coverage (custom models, accounting, audit, etc)
213-
// - [Maybe] Add retry logic for possibly transient issues
214-
// - [Maybe] Consider moving to concrete classes for the API JSON objects, or else move the ApiObject to a public module
215-
// - [Maybe] Python 2.7 compatibility
216-
217346

218347
//For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
219348

docs/Makefile

-20
This file was deleted.

docs/conf.py

-162
This file was deleted.

docs/contributing.rst

-1
This file was deleted.

docs/history.rst

-1
This file was deleted.

docs/index.rst

-19
This file was deleted.

0 commit comments

Comments
 (0)