Skip to content

Commit ceb1516

Browse files
committed
Updated docs
1 parent ef7a471 commit ceb1516

27 files changed

+1000
-15
lines changed

docs/intro.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -236,31 +236,31 @@ Returns a list of all the versions of the model with the specified id. No other
236236
Returns version details. It includes timeout, requirement, containerImage, loadStatus, runStatus, inputs, outputs, statistics, technicalDetails, sampleInput, sampleOutput, performanceSummary, processing, and others.
237237

238238
.getModelVersionInputSample
239-
Gets a job request sample for this model in JSON format (if it exists).
239+
Get a job request sample for this model in JSON format (if it exists).
240240

241241
.getModelVersionOutputSample
242-
Gets the output sample associated with the model and version provided (if it exists)
242+
Get the output sample associated with the model and version provided (if it exists)
243243

244244
.getJob
245-
Return the Job details, including the status, total, completed, and failed number of items.
245+
Return the job details, including the status, total, completed, and failed number of items.
246246

247247
.cancelJob
248-
Send a request to the server in order to cancel a Job
248+
Send a request to the server in order to cancel a job.
249249

250250
.getResult
251-
Return the current results of a Job execution, including completed, failed, total number of items processed
251+
Get the current results of a job execution, including completed, failed, total number of items processed.
252252

253253
.getOutputContents
254254
Get the contents of a specific job output. Consult the model's api for the output name and file type
255255

256256
.blockUntilJobComplete
257-
Blocks subsequent code execution until the job changes its status to COMPLETED, TIMEDOUT or CANCELED.
257+
Block subsequent code execution until the job changes its status to COMPLETED, TIMEDOUT or CANCELED.
258258

259259
.getJobHistory
260-
Gets a list of jobs meeting the search parameter criteria. Returns the latest 100 jobs if no params are sent.
260+
Get a paginated list of jobs meeting the search parameter criteria. Returns the latest 100 jobs if no params are sent.
261261

262262
.getProcessingEngineStatus
263-
Returns a list of all active processing engines and their status
263+
Return a list of all active processing engines and their status
264264

265265
.submitJobText
266266
Submit a job with plain text inputs
@@ -278,7 +278,7 @@ Submit a job based on a sql query on a database accessed through JDBC.
278278
Submit a job with the input(s) specified as a Blob (browser) or file path (Node.js)
279279

280280
.pathToDataUrl
281-
Converts a file path (string) to a data url for embedded job types (Node.js only)
281+
Convert a file path (string) to a data url for embedded job types (Node.js only)
282282

283283
.fileToDataUrl
284-
Converts a JS File Object to a data url for embedded job types (browser only)
284+
Convert a JS File Object to a data url for embedded job types (browser only)

docs/jobs/blockUntilJobComplete.md

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# modzyClient.blockUntilJobComplete
2+
3+
Block the script execution until the job status is "COMPLETED", "TIMEDOUT" or "CANCELED". By default it polls the job details every two seconds, but this interval can be changed using the options parameter.
4+
5+
```javascript
6+
await modzyClient.blockUntilJobComplete(jobId, options);
7+
```
8+
9+
## Options
10+
11+
- `jobId: string`
12+
- The job identifier, e.g. "14856eb1-0ad8-49e7-9da3-887acb80fea5"
13+
- `options: { timeout: number }`
14+
- The options object currently only has one key, `timeout` that is the refresh interval in milliseconds. Defaults to `2000`.
15+
16+
## Returns
17+
18+
A promise that resolves to a GetJobResponse object
19+
20+
```typescript
21+
interface GetJobResponse {
22+
jobIdentifier: string;
23+
submittedBy: string;
24+
accountIdentifier: string;
25+
model: {
26+
identifier: string;
27+
version: string;
28+
name: string;
29+
};
30+
status: string;
31+
createdAt: string;
32+
updatedAt: string;
33+
submittedAt: string;
34+
total: number;
35+
pending: number;
36+
completed: number;
37+
failed: number;
38+
elapsedTime: number;
39+
queueTime: number;
40+
user: {
41+
identifier: string;
42+
externalIdentifier: string;
43+
firstName: string;
44+
lastName: string;
45+
email: string;
46+
accessKeys: AccessKeys[];
47+
status: string;
48+
title: string;
49+
};
50+
jobInputs: JobInput[];
51+
explain: boolean;
52+
team: {
53+
identifier: string;
54+
};
55+
}
56+
57+
type AccessKeys = {
58+
prefix: string;
59+
isDefault: boolean;
60+
};
61+
62+
export type JobInput = {
63+
identifier: string;
64+
};
65+
```

docs/jobs/cancelJob.md

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# modzyClient.cancelJob
2+
3+
Send a request to the server in order to cancel a job.
4+
5+
```javascript
6+
const {
7+
accountIdentifier,
8+
completed,
9+
createdAt,
10+
elapsedTime,
11+
explain,
12+
failed,
13+
jobIdentifier,
14+
jobInputs,
15+
model,
16+
pending,
17+
queueTime,
18+
status,
19+
submittedAt,
20+
submittedBy,
21+
team,
22+
total,
23+
updatedAt,
24+
user,
25+
} = await modzyClient.cancelJob(jobId);
26+
```
27+
28+
## Options
29+
30+
- `jobId: string`
31+
- The job identifier, e.g. "14856eb1-0ad8-49e7-9da3-887acb80fea5"
32+
33+
## Returns
34+
35+
A promise that resolves to a GetJobResponse object
36+
37+
```typescript
38+
interface GetJobResponse {
39+
jobIdentifier: string;
40+
submittedBy: string;
41+
accountIdentifier: string;
42+
model: {
43+
identifier: string;
44+
version: string;
45+
name: string;
46+
};
47+
status: string;
48+
createdAt: string;
49+
updatedAt: string;
50+
submittedAt: string;
51+
total: number;
52+
pending: number;
53+
completed: number;
54+
failed: number;
55+
elapsedTime: number;
56+
queueTime: number;
57+
user: {
58+
identifier: string;
59+
externalIdentifier: string;
60+
firstName: string;
61+
lastName: string;
62+
email: string;
63+
accessKeys: AccessKeys[];
64+
status: string;
65+
title: string;
66+
};
67+
jobInputs: JobInput[];
68+
explain: boolean;
69+
team: {
70+
identifier: string;
71+
};
72+
}
73+
74+
type AccessKeys = {
75+
prefix: string;
76+
isDefault: boolean;
77+
};
78+
79+
export type JobInput = {
80+
identifier: string;
81+
};
82+
```

docs/jobs/getJob.md

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# modzyClient.getJob
2+
3+
Return the job details, including the status, total, completed, and failed number of items.
4+
5+
```javascript
6+
const {
7+
accountIdentifier,
8+
completed,
9+
createdAt,
10+
elapsedTime,
11+
explain,
12+
failed,
13+
jobIdentifier,
14+
jobInputs,
15+
model,
16+
pending,
17+
queueTime,
18+
status,
19+
submittedAt,
20+
submittedBy,
21+
team,
22+
total,
23+
updatedAt,
24+
user,
25+
} = await modzyClient.getJob(jobId);
26+
```
27+
28+
## Options
29+
30+
- `jobId: string`
31+
- The job identifier, e.g. "14856eb1-0ad8-49e7-9da3-887acb80fea5"
32+
33+
## Returns
34+
35+
A promise that resolves to a GetJobResponse object
36+
37+
```typescript
38+
interface GetJobResponse {
39+
jobIdentifier: string;
40+
submittedBy: string;
41+
accountIdentifier: string;
42+
model: {
43+
identifier: string;
44+
version: string;
45+
name: string;
46+
};
47+
status: string;
48+
createdAt: string;
49+
updatedAt: string;
50+
submittedAt: string;
51+
total: number;
52+
pending: number;
53+
completed: number;
54+
failed: number;
55+
elapsedTime: number;
56+
queueTime: number;
57+
user: {
58+
identifier: string;
59+
externalIdentifier: string;
60+
firstName: string;
61+
lastName: string;
62+
email: string;
63+
accessKeys: AccessKeys[];
64+
status: string;
65+
title: string;
66+
};
67+
jobInputs: JobInput[];
68+
explain: boolean;
69+
team: {
70+
identifier: string;
71+
};
72+
}
73+
74+
type AccessKeys = {
75+
prefix: string;
76+
isDefault: boolean;
77+
};
78+
79+
export type JobInput = {
80+
identifier: string;
81+
};
82+
```

docs/jobs/getJobHistory.md

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# modzyClient.getJobHistory
2+
3+
Get a paginated list of jobs meeting the search parameter criteria. Returns the latest 100 jobs if no params are sent.
4+
5+
```javascript
6+
const jobs = await modzyClient.getJobHistory({
7+
user,
8+
accessKey,
9+
startDate,
10+
endDate,
11+
model,
12+
status,
13+
page,
14+
perPage,
15+
direction,
16+
sortBy,
17+
});
18+
```
19+
20+
## Options
21+
22+
- `user?: string`
23+
- Name of the job submitter, e.g. "Jane Smith"
24+
- `accessKey?: string`
25+
- The prefix of the key used to submit the job, e.g. "jU7q896uSReJcXXDOS6P"
26+
- `startDate?: string`
27+
- Filters jobs by the start date. It requires ISO8601 format (YYYY-MM-DDThh:mm:ss.sTZD), e.g. "2022-04-15T14:28:01.053Z"
28+
- `endDate?: string`
29+
- Filters jobs by the end date. It requires ISO8601 format (YYYY-MM-DDThh:mm:ss.sTZD), e.g. "2022-04-15T14:28:01.053Z"
30+
- `model?: string`
31+
- Filters by the model name, e.g. "Sentiment Analysis"
32+
- `status?: "ALL" | "TERMINATED" | "TERMINATED_WITH_ERROR" | "PENDING"`
33+
- Filters by the job status
34+
- `page?: number`
35+
- The page number of the paginated results. Defaults to 1.
36+
- `perPage?: number`
37+
- The number of records returned per page. Defaults to 100.
38+
- `direction?: "ASC" | "DESC"`
39+
- Orders the records in ascending (ASC) or descending (DESC) order. Defaults to "ASC".
40+
- `sortBy?: string`
41+
- Results can be sorted by "identifier", "submittedBy", "submittedJobs", "status", "createdAt", "updatedAt", "submittedAt", "total", "completed", "fail" and "model".
42+
43+
## Returns
44+
45+
A promise that resolves to an array of JobHistoryResponseItem
46+
47+
```typescript
48+
interface JobHistoryResponseItem {
49+
jobIdentifier: string;
50+
submittedBy: string;
51+
accountIdentifier: string;
52+
model: {
53+
identifier: string;
54+
version: string;
55+
name: string;
56+
};
57+
status: string;
58+
createdAt: string;
59+
updatedAt: string;
60+
submittedAt: string;
61+
total: number;
62+
pending: number;
63+
completed: number;
64+
failed: number;
65+
elapsedTime: number;
66+
queueTime: number;
67+
user: {
68+
identifier: string;
69+
externalIdentifier: string;
70+
firstName: string;
71+
lastName: string;
72+
email: string;
73+
accessKeys: AccessKey[];
74+
status: string;
75+
title: string;
76+
};
77+
jobInputs: any[];
78+
explain: boolean;
79+
}
80+
81+
type AccessKey = {
82+
prefix: string;
83+
isDefault: boolean;
84+
};
85+
```

docs/jobs/getOutputContents.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# modzyClient.getOutputContents
2+
3+
Get the contents of a specific job output. The format can be changed for text or binary file output types.
4+
5+
```javascript
6+
const outputContents = await modzyClient.getOutputContents({
7+
jobId,
8+
inputKey,
9+
outputName,
10+
responseType,
11+
});
12+
```
13+
14+
## Options
15+
16+
- `jobId: string`
17+
- The job identifier, e.g. "14856eb1-0ad8-49e7-9da3-887acb80fea5"
18+
- `inputKey: string`
19+
- The user-defined key used to identify the job input, e.g. "my-input"
20+
- `outputName: string`
21+
- The model-defined name of the output, e.g. "results.wav". Consult the API section of the model details page to get the model output name.
22+
- `responseType: "json" | "blob" | "arraybuffer"`
23+
- How the response should be formatted. Use "json" for text outputs. Use "blob" for binary files in a browser environment. Use "arraybuffer" for binary files in a Node.js environment. Defaults to "json".
24+
25+
## Returns
26+
27+
A promise that resolves to an unknown type (The actual result depends on the model's output and the response type specified).

0 commit comments

Comments
 (0)