Skip to content

Commit 7d03d7f

Browse files
committed
samples
1 parent d6f9e8b commit 7d03d7f

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed

README.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ 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.
178+
177179
link:https://models.modzy.com/docs/jobs/jobs/submit-job-text[Submit a job with the model, version, and input items]:
178180

179181
[source, js]

samples.adoc

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
2+
3+
4+
These samples show how to submit jobs with `embedded`, `aws-s3`, `aws-s3-folder`, and `jdbc` input types.
5+
6+
7+
This sample submits a job with an embedded image:
8+
9+
[source, js]
10+
----
11+
{
12+
"provide-any-name": {"model-input-name": "data:image/jpeg;base64,/.../2Q=="}
13+
}
14+
----
15+
16+
This sample submits a job with a text file hosted in a `aws-s3` bucket:
17+
18+
[source, js]
19+
----
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+
}
36+
----
37+
38+
This sample submits a job with a all the files located in a `aws-s3` bucket directory:
39+
40+
[source, js]
41+
----
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+
}
58+
----
59+
60+
This sample submits a job with data located in a `jdbc` database:
61+
62+
[source, js]
63+
----
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+
}
74+
----

0 commit comments

Comments
 (0)