-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathAPISnippetSchemas.ts
More file actions
336 lines (335 loc) · 9.39 KB
/
APISnippetSchemas.ts
File metadata and controls
336 lines (335 loc) · 9.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
export interface APIType {
path: string;
method: string;
headers?: Record<string, string>;
body?: any;
query?: Record<string, string>;
sdk_key_string: string;
skip_request?: boolean;
direct_id?: string;
}
export const APISchemas: {
[key: string]: APIType;
} = {
"ai-scrape": {
path: "/v1/ai/scrape",
method: "POST",
body: {
url: "https://news.ycombinator.com/news",
element_prompts: ["titles", "points"],
},
sdk_key_string: "web.ai_scrape",
},
sentiment: {
path: "/v1/ai/sentiment",
method: "POST",
body: {
text: "I love this product! It's amazing but the delivery was a bit late.",
},
sdk_key_string: "sentiment",
},
classification: {
path: "/v1/classification",
method: "POST",
body: {
dataset: [
{ type: "image", value: "https://jigsawstack.com/preview/classification-example-1.jpg" },
{ type: "image", value: "https://jigsawstack.com/preview/classification-example-2.jpg" },
],
labels: [
{ type: "text", value: "hotdog" },
{ type: "text", value: "not a hotdog" },
],
},
sdk_key_string: "classification",
},
translate: {
path: "/v1/ai/translate",
method: "POST",
body: {
text: ["Hello", "How are you?", "Thank you"],
target_language: "zh",
},
sdk_key_string: "translate.text",
},
summary: {
path: "/v1/ai/summary",
method: "POST",
body: {
text: "The Leaning Tower of Pisa, or simply, the Tower of Pisa, is the campanile, or freestanding bell tower, of Pisa Cathedral. It is situated behind the Cathedral and is the third-oldest structure in the city's Cathedral Square, after the Cathedral and the Baptistry. The tower's tilt began during construction in the 12th century, caused by an inadequate foundation on ground too soft on one side to properly support the structure's weight. The tilt increased in the decades before the structure was completed in the 14th century. It gradually increased until the structure was stabilized by efforts in the late 20th and early 21st centuries. The height of the tower is 55.86 metres (183.27 feet) from the ground on the low side and 56.67 metres (185.93 feet) on the high side. The width of the walls at the base is 2.44 m (8 ft 0.06 in). Its weight is estimated at 14,500 tonnes. The tower has 296 or 294 steps; the seventh floor has two fewer steps on the north-facing staircase.",
type: "points",
max_points: 3,
},
sdk_key_string: "summary",
},
prediction: {
path: "/v1/ai/prediction",
method: "POST",
body: {
dataset: [
{ date: "2023-01-01", value: 353459 },
{ date: "2023-01-02", value: 313734 },
{ date: "2023-01-03", value: 333774 },
{ date: "2023-01-04", value: 348636 },
{ date: "2023-01-05", value: 278903 },
],
steps: 3,
},
sdk_key_string: "prediction",
},
sql: {
path: "/v1/ai/sql",
method: "POST",
body: {
database: "postgresql",
prompt: "Find all transactions with amounts exceeding $10,000, sorted by transaction date",
sql_schema: `
CREATE TABLE Transactions (
transaction_id INT PRIMARY KEY,
user_id INT NOT NULL,
total_amount DECIMAL(10, 2) NOT NULL,
transaction_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
status VARCHAR(20) DEFAULT 'pending',
FOREIGN KEY(user_id) REFERENCES Users(user_id)
)
`,
},
sdk_key_string: "text_to_sql",
},
"ai-search": {
path: "/v1/web/search",
method: "POST",
body: {
query: "What is the capital of France?",
},
sdk_key_string: "web.search",
},
"search-suggestions": {
path: "/v1/web/search/suggest",
method: "GET",
query: {
query: "What is the capital",
},
sdk_key_string: "web.search_suggestions",
},
embedding: {
path: "/v1/embedding",
method: "POST",
body: {
text: "Caption: Secluded Tiki Bar on a serene lake, perfect for a refreshing drink and a relaxing getaway",
type: "text",
},
sdk_key_string: "embedding",
},
"embedding-v2": {
path: "/v2/embedding",
method: "POST",
body: {
url: "https://jigsawstack.com/preview/stt-example.wav",
type: "audio",
speaker_fingerprint: true
},
sdk_key_string: "embedding_v2",
},
"object-detection": {
path: "/v1/object_detection",
method: "POST",
body: {
url: "https://jigsawstack.com/preview/object-detection-example-input.jpg",
// prompts: ["objects on the screen"],
features: ["object_detection"],
annotated_image: true,
return_type: "url",
},
sdk_key_string: "vision.object_detection",
},
vocr: {
path: "/v1/vocr",
method: "POST",
body: {
prompt: ["total_price", "tax"],
url: "https://jigsawstack.com/preview/vocr-example.jpg",
},
sdk_key_string: "vision.vocr",
},
"speech-to-text": {
path: "/v1/ai/transcribe",
method: "POST",
body: {
url: "https://jigsawstack.com/preview/stt-example.wav",
},
sdk_key_string: "audio.speech_to_text",
},
"spam-check": {
path: "/v1/validate/spam_check",
method: "POST",
body: {
text: "Congratulations! You've won a free iPhone! Click here to claim now!",
},
sdk_key_string: "validate.spamcheck",
},
nsfw: {
path: "/v1/validate/nsfw",
method: "POST",
body: {
url: "https://jigsawstack.com/preview/nsfw-example.jpg",
},
sdk_key_string: "validate.nsfw",
},
profanity: {
path: "/v1/validate/profanity",
method: "POST",
body: {
text: "This is a sample text that might contain inappropriate language.",
},
sdk_key_string: "validate.profanity",
},
spellcheck: {
path: "/v1/validate/spell_check",
method: "POST",
body: {
text: "This sentense has a speling mistake.",
},
sdk_key_string: "validate.spellcheck",
},
"file-upload": {
path: "/v1/store/file",
method: "POST",
body: {
blob: "image-123.png",
key: "image-123.png",
},
sdk_key_string: "store.upload",
skip_request: true,
},
"file-get": {
path: "/v1/store/file/read/image-123.png",
method: "GET",
query: {
key: "image-123.png",
},
sdk_key_string: "store.get",
skip_request: true,
},
"file-delete": {
path: "/v1/store/file/read/image-123.png",
method: "DELETE",
query: {
key: "image-123.png",
},
sdk_key_string: "store.delete",
skip_request: true,
},
"image-generation": {
path: "/v1/ai/image_generation",
method: "POST",
body: {
prompt: "A beautiful sunset over a calm ocean",
return_type: "url",
},
sdk_key_string: "image_generation",
},
"image-translate": {
path: "/v1/ai/translate/image",
method: "POST",
body: {
url: "https://images.unsplash.com/photo-1528716321680-815a8cdb8cbe?q=80&w=1376&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
target_language: "hi",
return_type: "url",
},
sdk_key_string: "translate.image",
},
"html-to-any": {
path: "/v1/web/html_to_any",
method: "POST",
body: {
url: "https://news.ycombinator.com/",
return_type: "url",
},
sdk_key_string: "web.html_to_any",
},
"deep-research": {
path: "/v1/web/deep_research",
method: "POST",
body: {
query: "What is the meaning of life?",
},
sdk_key_string: "web.deep_research",
},
"prompt-engine-create": {
path: "/v1/prompt_engine",
method: "POST",
body: {
prompt: "Tell me a story about {about}",
inputs: [
{
key: "about",
optional: false,
initial_value: "Leaning Tower of Pisa",
},
],
return_prompt: "Return the result in a markdown format",
prompt_guard: ["sexual_content", "defamation"],
},
sdk_key_string: "prompt_engine.create",
},
"prompt-engine-run": {
path: "/v1/prompt_engine/0073d008-da9b-4c27-90a8-0240f3ecd4f5",
method: "POST",
query: {
id: "0073d008-da9b-4c27-90a8-0240f3ecd4f5",
},
body: {
input_values: {
text: "How to get started with JigsawStack?",
},
},
sdk_key_string: "prompt_engine.run",
},
"prompt-engine-retrieve": {
path: "/v1/prompt_engine/14d675d5-b309-463d-8906-1be65af74c43",
method: "GET",
query: {
id: "14d675d5-b309-463d-8906-1be65af74c43",
},
sdk_key_string: "prompt_engine.get",
skip_request: true,
},
"prompt-engine-list": {
path: "/v1/prompt_engine",
method: "GET",
query: {
limit: "10",
},
sdk_key_string: "prompt_engine.list",
},
"prompt-engine-delete": {
path: "/v1/prompt_engine/${id}",
method: "DELETE",
query: {
promptId: "dc578c69-6eb5-4c5b-82ab-9f74077cfdd5",
},
sdk_key_string: "prompt_engine.delete",
skip_request: true,
},
"prompt-engine-run-direct": {
path: "/v1/prompt_engine/run",
method: "POST",
body: {
prompt: "Tell me a story about {about}",
inputs: [
{
key: "about",
optional: true,
initial_value: "Leaning Tower of Pisa",
},
],
return_prompt: "Return the result in a markdown format",
prompt_guard: ["sexual_content", "defamation"],
input_values: {
about: "Santorini",
},
},
sdk_key_string: "prompt_engine.run_prompt_direct",
},
};