Skip to content

Commit 43537a6

Browse files
committed
samples
1 parent 7d03d7f commit 43537a6

File tree

2 files changed

+54
-47
lines changed

2 files changed

+54
-47
lines changed

README.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ A *job* is the process that sends data to a model, sets the model to run the dat
174174

175175
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`.
176176

177-
link:https://github.com/modzy/sdk-javascript/blob/main/samples[Here] are samples to submit jobs with `embedded`, `aws-s3`, `aws-s3-folder`, and `jdbc` input types.
177+
link:https://github.com/modzy/sdk-javascript/blob/readmeUpdates/samples.adoc[Here] are samples to submit jobs with `embedded`, `aws-s3`, `aws-s3-folder`, and `jdbc` input types.
178178

179179
link:https://models.modzy.com/docs/jobs/jobs/submit-job-text[Submit a job with the model, version, and input items]:
180180

samples.adoc

Lines changed: 53 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,81 @@
11

22

33

4-
These samples show how to submit jobs with `embedded`, `aws-s3`, `aws-s3-folder`, and `jdbc` input types.
4+
= These samples show how to submit jobs with `embedded`, `aws-s3`, `aws-s3-folder`, and `jdbc` input types.
55

66

77
This sample submits a job with an embedded image:
88

99
[source, js]
1010
----
11-
{
12-
"provide-any-name": {"model-input-name": "data:image/jpeg;base64,/.../2Q=="}
13-
}
11+
let job = await modzyClient.submitJobEmbedded(
12+
"ed542963de",
13+
"0.0.27",
14+
"application/octet-stream",
15+
{
16+
"provide-any-name": {"model-input-name": "data:image/jpeg;base64,/.../2Q=="}
17+
}
18+
);
1419
----
1520

1621
This sample submits a job with a text file hosted in a `aws-s3` bucket:
1722

1823
[source, js]
1924
----
20-
{
21-
"ed542963de",
22-
"0.0.27",
23-
"accessKeyID": "key",
24-
"secretAccessKey": "secret-key",
25-
"region": "us-east-1",
26-
"sources":
27-
{
28-
"provide-any-name": {
29-
"model-input-name": {
30-
"bucket": "bucket-name",
31-
"key": "input_folder/happy.txt"
32-
}
33-
}
34-
}
35-
}
25+
let job = await modzyClient.submitJobAWSS3(
26+
"ed542963de",
27+
"0.0.27",
28+
"accessKeyID",
29+
"secretAccessKey",
30+
"us-east-1",
31+
{
32+
"provide-any-name": {
33+
"model-input-name": {
34+
"bucket": "bucket-name",
35+
"key": "input_folder/happy.txt"
36+
}
37+
}
38+
}
39+
);
3640
----
3741

3842
This sample submits a job with a all the files located in a `aws-s3` bucket directory:
3943

4044
[source, js]
4145
----
42-
{
43-
"ed542963de",
44-
"0.0.27",
45-
"accessKeyID": "key",
46-
"secretAccessKey": "secret-key",
47-
"region": "us-east-1",
48-
"sources": {
49-
"provide-any-name": {
50-
"model-input-name": {
51-
"bucket": "bucket-name",
52-
"key": "image_input_folder"
53-
54-
}
55-
}
56-
}
57-
}
46+
//update
47+
let job = await modzyClient.submitJobAWSS3(
48+
"ed542963de",
49+
"0.0.27",
50+
"accessKeyID",
51+
"secretAccessKey",
52+
"us-east-1",
53+
{
54+
"provide-any-name": {
55+
"model-input-name": {
56+
"bucket": "bucket-name",
57+
"key": "image_input_folder"
58+
}
59+
}
60+
}
61+
);
5862
----
5963

6064
This sample submits a job with data located in a `jdbc` database:
6165

6266
[source, js]
6367
----
64-
{
65-
{
66-
"provide-any-name": {
67-
"type": "jdbc",
68-
"url": "jdbc:sql://database-server.runajob.com:5432/db",
69-
"username": "user",
70-
"password": "password",
71-
"driver": "org.postgresql.Driver",
72-
"query":"select description as \"model-input-name\" from models.model"
73-
}
68+
//update
69+
let job = await modzyClient.submitJobAWSS3(
70+
"ed542963de",
71+
"0.0.27",
72+
{
73+
"type": "jdbc",
74+
"url": "jdbc:sql://database-server.runajob.com:5432/db",
75+
"username": "user",
76+
"password": "password",
77+
"driver": "org.postgresql.Driver",
78+
"query":"select description as \"model-input-name\" from models.model"
79+
}
80+
);
7481
----

0 commit comments

Comments
 (0)