Skip to content

Commit 94a90b9

Browse files
authored
Fix API examples page (#32)
1 parent 07fbece commit 94a90b9

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

client/src/components/apps/AppApiExamples.jsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ url = '${window.location.origin}/api/apps/${app?.uuid}/run'
3232
3333
payload = {
3434
"input": {
35-
${Object.keys(app?.input_schema?.properties || {})
36-
.map((k) => `"${k}": "<${k}_value>"`)
35+
${app?.data.input_fields
36+
.map(({ name }) => `"${name}": "<${name}_value>"`)
3737
.join(",\n ")}
3838
},
3939
"stream": False,
@@ -53,8 +53,8 @@ url = '${window.location.origin}/api/apps/${app?.uuid}/run'
5353
5454
payload = {
5555
"input": {
56-
${Object.keys(app?.input_schema?.properties || {})
57-
.map((k) => `"${k}": "<${k}_value>"`)
56+
${app?.data.input_fields
57+
.map(({ name }) => `"${name}": "<${name}_value>"`)
5858
.join(",\n ")}
5959
},
6060
"stream": True,
@@ -75,8 +75,8 @@ for line in response.iter_lines():
7575
--header 'Authorization: Token ${profile?.token}' \\
7676
--data-raw '{
7777
"input": {
78-
${Object.keys(app?.input_schema?.properties || {})
79-
.map((k) => `"${k}": "<${k}_value>"`)
78+
${app?.data.input_fields
79+
.map(({ name }) => `"${name}": "<${name}_value>"`)
8080
.join(",\n ")}
8181
},
8282
"stream": false
@@ -88,8 +88,8 @@ for line in response.iter_lines():
8888
--header 'Authorization: Token ${profile?.token}' \\
8989
--data-raw '{
9090
"input": {
91-
${Object.keys(app?.input_schema?.properties || {})
92-
.map((k) => `"${k}": "<${k}_value>"`)
91+
${app?.data.input_fields
92+
.map(({ name }) => `"${name}": "<${name}_value>"`)
9393
.join(",\n ")}
9494
},
9595
"stream": true
@@ -101,8 +101,8 @@ const url = '${window.location.origin}/api/apps/${app?.uuid}/run';
101101
const PROMPTLY_TOKEN = '${profile?.token}';
102102
const payload = {
103103
"input": {
104-
${Object.keys(app?.input_schema?.properties || {})
105-
.map((k) => `"${k}": "<${k}_value>"`)
104+
${app?.data.input_fields
105+
.map(({ name }) => `"${name}": "<${name}_value>"`)
106106
.join(",\n ")}
107107
},
108108
"stream": false,
@@ -124,8 +124,8 @@ const url = '${window.location.origin}/api/apps/${app?.uuid}/run';
124124
const PROMPTLY_TOKEN = '${profile?.token}';
125125
const payload = {
126126
"input": {
127-
${Object.keys(app?.input_schema?.properties || {})
128-
.map((k) => `"${k}": "<${k}_value>"`)
127+
${app?.data.input_fields
128+
.map(({ name }) => `"${name}": "<${name}_value>"`)
129129
.join(",\n ")}
130130
},
131131
"stream": true,

0 commit comments

Comments
 (0)