Skip to content

Commit bc2c7e0

Browse files
danieljbruceAce Nassri
authored andcommitted
samples: remove the json parse for inputs parameter (#582)
1 parent c5156e9 commit bc2c7e0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

automl/tables/predict.v1beta1.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ async function main(
1919
modelId = 'YOUR_MODEL_ID',
2020
inputs = '[{"numberValue": 1}, {"stringValue": "value"}]'
2121
) {
22+
inputs = JSON.parse(inputs);
23+
2224
// [START automl_tables_predict]
2325

2426
/**
@@ -39,8 +41,6 @@ async function main(
3941
// Get the full path of the model.
4042
const modelFullId = automlClient.modelPath(projectId, computeRegion, modelId);
4143

42-
inputs = JSON.parse(inputs);
43-
4444
async function predict() {
4545
// Set the payload by giving the row values.
4646
const payload = {

0 commit comments

Comments
 (0)