Skip to content

Commit bf58913

Browse files
committed
updates
1 parent a7c56f6 commit bf58913

File tree

1 file changed

+73
-44
lines changed

1 file changed

+73
-44
lines changed

README.adoc

Lines changed: 73 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -12,60 +12,33 @@
1212
<h1>Javascript SDK</h1>
1313
1414
<div align="center">
15-
1615
<br>
1716
<br>
18-
19-
2017
<img src="https://www.modzy.com/wp-content/uploads/2019/10/modzy-logo-tm.svg" alt="Modzy" width="350" height="auto">
21-
2218
<br>
2319
<br>
2420
<br>
2521
<br>
26-
27-
28-
29-
3022
<p><b>Modzy's Javascript SDK queries models, submits inference jobs, and returns results directly to your editor.</b></p>
31-
32-
3323
<br>
34-
35-
3624
<img alt="GitHub contributors" src="https://img.shields.io/github/contributors/modzy/sdk-javascript">
37-
3825
<img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/modzy/sdk-javascript">
39-
4026
<img alt="GitHub Release Date" src="https://img.shields.io/github/release-date/modzy/sdk-javascript">
41-
4227
</div>
43-
4428
<br>
4529
<br>
46-
4730
<div align="center">
4831
<a href=https://models.modzy.com/docs/how-to-guides/job-lifecycle style="text-decoration:none">The job lifecycle</a> |
4932
<a href=https://models.modzy.com/docs/how-to-guides/api-keys style="text-decoration:none">API keys</a> |
5033
<a href=/samples style="text-decoration:none">Samples</a> |
5134
<a href=https://models.modzy.com/docs/home/home style="text-decoration:none">Documentation</a>
52-
53-
5435
<br>
5536
<br>
5637
<br>
5738
<br>
58-
59-
60-
6139
<br>
62-
6340
</div>
64-
6541
<br>
66-
67-
68-
6942
++++
7043

7144

@@ -74,7 +47,7 @@
7447

7548
++++
7649
<br>
77-
<div align="center>
50+
<div align="center">
7851
<a href="https://asciinema.org/a/B1IkRkW4LjW7sufkjoMWoETH6"><img src="install.gif" style="max-width:100%"/></a>
7952
</div>
8053
<br>
@@ -92,38 +65,54 @@ Clone the repository:
9265

9366
//no reference to node.js in here but it is in contributing.
9467

95-
== Usage
68+
== Initialize
69+
70+
Once you have a `model` and `version` identified, get authenticated with your API key.
71+
72+
API keys are security credentials required to perform API requests to Modzy. Our API keys are composed of an ID that is split by a dot into two parts: the prefix and the body. +
73+
The *prefix* is the API keys' visible part. It’s only used to identify the key and by itself, it’s unable to perform API requests.
9674

75+
link:https://models.modzy.com/docs/users-keys/api-keys/retrieve-users-api-keys[List your API keys]:
9776

98-
=== Initialize
77+
[source, js]
78+
----
79+
----
80+
81+
The *body* is the prefix’s complement and it’s required to perform API requests. Since it’s not stored on Modzy’s servers, it cannot be recovered. Make sure to save it securely. If lost, you can link:https://models.modzy.com/docs/users-keys/api-keys/replace-API-key[replace the API key's body].
82+
83+
link:https://models.modzy.com/docs/users-keys/api-keys/retrieve-full-API-key[Retrieve the API key's body]:
84+
85+
[source, js]
86+
----
87+
----
9988

100-
Once you have a `model` and `version` identified, authenticate to Modzy with your API key:
89+
Get authenticated with your API key:
10190

10291
[source, js]
10392
----
10493
const modzy = require('modzy-sdk');
105-
const modzyClient = new modzy.ModzyClient("http://url.to.modzy/api", "my_key.modzy");
94+
const modzyClient = new modzy.ModzyClient("http://url.to.modzy/api", "prefix.body");
10695
----
10796

108-
=== Basic usage
97+
== Basic usage
10998

11099
++++
111100
<br>
101+
<div align="center">
102+
<img src="js.gif" alt="basic usage" style="max-width:100%">
103+
</div>
104+
<br>
112105
++++
113106

114-
The code below is applicable for `text/plain` input type.
115107

116-
++++
117-
<div align="center">
118108

119-
<img src="js.gif" alt="basic usage" style="max-width:100%">
109+
=== Browse models
120110

121-
</div>
111+
Modzy’s Marketplace includes pre-trained and re-trainable AI models from industry-leading machine learning companies, accelerating the process from data to value.
122112

123-
<br>
124-
++++
113+
The Model service drives the Marketplace and can be integrated with other applications, scripts, and systems. It provides routes to list, search, and filter model and model-version details.
125114

126-
Browse models:
115+
link:https://models.modzy.com/docs/marketplace/models/retrieve-models[List models]
127116

128117
[source, js]
129118
----
@@ -138,17 +127,54 @@ try{
138127
139128
----
140129

130+
Tags help categorize and filter models. They make model browsing easier.
131+
132+
link:https://models.modzy.com/docs/marketplace/tags/retrieve-tags[List tags]:
133+
134+
[source, js]
135+
----
136+
137+
----
138+
139+
link:https://models.modzy.com/docs/marketplace/tags/retrieve-models-by-tags[List models by tag]:
140+
141+
[source, js]
142+
----
143+
144+
----
145+
146+
=== Get a model's details
147+
148+
Models accept specific *input file link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types[MIME] types*. Some models may require multiple input file types to run data accordingly. In this sample, we use a model that requires `input.txt`.
141149

142-
Get a model's details:
150+
Models require inputs to have a specific *input name* declared in the job request. This name can be found in the model’s details. In this sample, we use a model that requires `text/plain`.
151+
152+
Additionally, users can set their own input names. When multiple input items are processed in a job, these names are helpful to identify and get each input’s results. In this sample, we use a model that requires `input-1` and `input-2`.
153+
154+
link:https://models.modzy.com/docs/marketplace/models/retrieve-model-details[Get a model's details]:
143155

144156
[source, js]
145157
----
146158
const saModel = await modzyClient.getModel("ed542963de");
147159
console.log(JSON.stringify(saModel));
148160
----
149161

162+
Model specific sample requests are available in the version details and in the Model Details page.
150163

151-
Submit a job providing the model, version, and input file:
164+
link:https://models.modzy.com/docs/marketplace/versions/retrieve-version-details[Get version details]:
165+
166+
[source, js]
167+
----
168+
169+
----
170+
171+
=== Submit a job and get results
172+
173+
A *job* is the process that sends data to a model, sets the model to run the data, and returns results.
174+
175+
Modzy supports several *input types* such as `text`, `embedded` for Base64 strings, `aws-s3` and `aws-s3-folder` for inputs hosted in buckets, and `jdbc` for inputs stored in databases. In this sample, we use `text`.
176+
177+
Submit a job with the model, version, and input items:
152178

153179
[source, js]
154180
----
@@ -167,7 +193,6 @@ Hold until the inference is complete and results become available:
167193
[source, js]
168194
----
169195
job = await modzyClient.blockUntilComplete(job);
170-
171196
----
172197

173198
Get the output results:
@@ -202,6 +227,10 @@ catch(error){
202227

203228
== Features
204229

230+
Modzy supports link:https://models.modzy.com/docs/features/batch-processing[batch processing], link:https://models.modzy.com/docs/features/explainability[explainability], and link:https://models.modzy.com/docs/features/model-drift[model drift detection].
231+
232+
== APIs
233+
205234
Currently we support the following api routes:
206235

207236
:doc-pages: https://models.modzy.com/docs/

0 commit comments

Comments
 (0)