From d1056e3266935629e9ca4bec5a2388b599d8af48 Mon Sep 17 00:00:00 2001 From: Norman Kong Date: Tue, 27 Nov 2018 05:30:24 +0800 Subject: [PATCH] fix: Param "scoreThreshold" should be "score_threshold" (#234) Sine 18 Oct 2018, I found that the scoreThreshold param won't work and encounter "Error: 3 INVALID_ARGUMENT: Request contains an invalid argument." during prediction call. I compared the doc below and the params should be score_threshold instead of scoreThreshold. https://cloud.google.com/vision/automl/docs/reference/rest/v1beta1/projects.locations.models/predict#request-body --- vision/samples/automl/automlVisionPredict.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vision/samples/automl/automlVisionPredict.js b/vision/samples/automl/automlVisionPredict.js index 37bfcecf10..2b654a3b7b 100755 --- a/vision/samples/automl/automlVisionPredict.js +++ b/vision/samples/automl/automlVisionPredict.js @@ -55,7 +55,7 @@ async function predict( const params = {}; if (scoreThreshold) { - params.scoreThreshold = scoreThreshold; + params.score_threshold = scoreThreshold; } // Set the payload by giving the content and type of the file.