@@ -184,12 +184,14 @@ Vision.prototype.annotate = function(requests, callback) {
184184 * @param {string|string[]|module:storage/file|module:storage/file[] } images -
185185 * The source image(s) to run the detection on. It can be either a local
186186 * image path or a gcloud File object.
187- * @param {string[]|object } config - An array of types or a configuration
187+ * @param {string[]|object= } options - An array of types or a configuration
188188 * object.
189- * @param {string[] } config.types - An array of feature types to detect from the
190- * provided images. Acceptable values: `faces`, `landmarks`, `labels`,
189+ * @param {number } options.maxResults - The maximum number of results, per type,
190+ * to return in the response.
191+ * @param {string[] } options.types - An array of feature types to detect from
192+ * the provided images. Acceptable values: `faces`, `landmarks`, `labels`,
191193 * `logos`, `properties`, `safeSearch`, `text`.
192- * @param {boolean= } config .verbose - Use verbose mode, which returns a less-
194+ * @param {boolean= } options .verbose - Use verbose mode, which returns a less-
193195 * simplistic representation of the annotation (default: `false`).
194196 * @param {function } callback - The callback function.
195197 * @param {?error } callback.err - An error returned while making this request.
@@ -292,12 +294,18 @@ Vision.prototype.detect = function(images, options, callback) {
292294 throw new Error ( 'Requested detection feature not found: ' + type ) ;
293295 }
294296
295- config . push ( {
297+ var cfg = {
296298 image : image ,
297299 features : {
298300 type : typeName
299301 }
300- } ) ;
302+ } ;
303+
304+ if ( is . number ( options . maxResults ) ) {
305+ cfg . features . maxResults = options . maxResults ;
306+ }
307+
308+ config . push ( cfg ) ;
301309 } ) ;
302310 } ) ;
303311
0 commit comments