diff --git a/automl/tables/predict.v1beta1.js b/automl/tables/predict.v1beta1.js index 5954004136d..2e144148094 100644 --- a/automl/tables/predict.v1beta1.js +++ b/automl/tables/predict.v1beta1.js @@ -19,6 +19,8 @@ async function main( modelId = 'YOUR_MODEL_ID', inputs = '[{"numberValue": 1}, {"stringValue": "value"}]' ) { + inputs = JSON.parse(inputs); + // [START automl_tables_predict] /** @@ -39,8 +41,6 @@ async function main( // Get the full path of the model. const modelFullId = automlClient.modelPath(projectId, computeRegion, modelId); - inputs = JSON.parse(inputs); - async function predict() { // Set the payload by giving the row values. const payload = {