Repository navigation
How to change Client GRPC deadline? #283
Description
Activity
@jmuk How would one increase the deadline?
The autogen layer can customize the deadline through the
CallOptionparameter, however@google-cloud/speechhand-written layer doesn't allow passing timeout by themselves.Which method are you using? I'm wild-guessing that
asyncRecognizedoes not have such restriction.Something like this would work:
const v1beta1 = require('@google-cloud/speech').v1beta1(); const speech = v1beta1.speechClient(); const request = { audio: { uri: 'gs://my-bucket/filename.raw' }, config: { encoding: 'LINEAR16', sampleRate: 16000 } }; const options = { longrunning: { initialRetryDelayMillis: 100, , // Default retryDelayMultiplier: 1.3, // Default maxRetryDelayMillis: 60000, // Default initialRpcTimeoutMillis: null, // Default rpcTimeoutMultiplier: null, // Default maxRpcTimeoutMillis: null, // Default totalTimeoutMillis: 600000 // Default } }; speech.syncRecognize(request, options) .then((results) => { const transcription = results[0]; console.log(transcription); });
@jmdobry Would this work with recognizeStream?
I'm not sure the bi-directional streaming uses exponential backoff. @jmuk?
@bloodcarter:
createRecognizeStreamcan customize the timeout as https://github.com/GoogleCloudPlatform/google-cloud-node/blob/master/packages/speech/src/index.js#L378const speech = require('@google-cloud')(); const stream = speech.createRecognizeStream(..., {timeout: 300}); ...
@jmdobry: bidi streaming does not use exponential backoff, but uses
timeoutfield in the options.const v1beta1 = require('@google-cloud/speech').v1beta1(); const speech = v1beta1.speechClient(); // set the timeout to 300 seconds. const stream = speech.streamingRecognize({timeout: 300}); stream.write(...); ...
This should customize the timeout.
- added🚨This issue needs some love.This issue needs some love.triage meI really want to be triaged.I really want to be triaged.
on Apr 6, 2020 - added 2 commits that reference this issue
on Nov 10, 2022 - added 12 commits that reference this issue
on Nov 11, 2022 - added 2 commits that reference this issue
on Nov 17, 2022 - added 2 commits that reference this issue
on Nov 21, 2022 - added a commit that references this issue
on Feb 16, 2023
I randomly receive this error while streaming data:
Client GRPC deadline too short. Should be at least: 3 * audio-duration + 5 seconds. Current deadline is: 59.699356980447192 second(s). Required at least: 60 second(s).What should I do with that?