As I am aware of the limitations listed here, I need to receive some clarifications on the quota limit. I'm using the Node.js library to make a simple asynchronous speech-to-text API, using a .raw file which is stored in my bucket. After the request is done, when checking the API Manager Traffic, the daily requests counter is increased by 50 to 100 requests. I am not using any kind of requests libraries or other frameworks. Just the code from the gCloud docs.
var file = URL.bucket + "audio.raw"; //require from upload.
speech.startRecognition(file, config).then((data) => {
var operation = data[0];
operation.on('complete', function(transcript) {
console.log(transcript);
});
})
I believe this has to do with the
operation.oncall, which registers a listener for the operation to complete, but continues to poll the service until it does finally finish.I think, based on looking at some code, that you can change the interval at which the service will poll using the
longrunning.initialRetryDelayMillissetting, which should reduce the number of requests you see in your quota consumption.Some places to look:
Speech client constructor: https://github.com/GoogleCloudPlatform/google-cloud-node/blob/master/packages/speech/src/index.js#L70
GAX Speech Client's constructor: https://github.com/GoogleCloudPlatform/google-cloud-node/blob/master/packages/speech/src/v1/speech_client.js#L67
Operations client: https://github.com/googleapis/gax-nodejs/blob/master/lib/operations_client.js#L74
GAX's Operation: https://github.com/googleapis/gax-nodejs/blob/master/lib/longrunning.js#L304