add a bit more info logging to gather (#1211)

This commit is contained in:
Dave Horton
2025-05-26 09:34:21 -04:00
committed by GitHub
parent f670626cf7
commit 603dd482bc

View File

@@ -612,7 +612,7 @@ class TaskGather extends SttTask {
}
_startTranscribing(ep) {
this.logger.debug({
this.logger.info({
vendor: this.vendor,
locale: this.language,
interim: this.interim,
@@ -691,7 +691,7 @@ class TaskGather extends SttTask {
assert(this.isContinuousAsr);
this._clearAsrTimer();
this._asrTimer = setTimeout(() => {
this.logger.debug('_startAsrTimer - asr timer went off');
this.logger.info('_startAsrTimer - asr timer went off');
const evt = this.consolidateTranscripts(this._bufferedTranscripts, 1, this.language, this.vendor);
/* special case for speechmatics - keep listening if we dont have any transcripts */
@@ -702,7 +702,7 @@ class TaskGather extends SttTask {
}
this._resolve(this._bufferedTranscripts.length > 0 ? 'speech' : 'timeout', evt);
}, this.asrTimeout);
this.logger.debug(`_startAsrTimer: set for ${this.asrTimeout}ms`);
this.logger.info(`_startAsrTimer: set for ${this.asrTimeout}ms`);
}
_clearAsrTimer() {
@@ -714,7 +714,7 @@ class TaskGather extends SttTask {
}
_hangupCall() {
this.logger.debug('_hangupCall');
this.logger.debug('TaskGather:_hangupCall');
this.cs.hangup();
}
@@ -737,7 +737,7 @@ class TaskGather extends SttTask {
_startFinalAsrTimer() {
this._clearFinalAsrTimer();
this._finalAsrTimer = setTimeout(() => {
this.logger.debug('_startFinalAsrTimer - final asr timer went off');
this.logger.info('_startFinalAsrTimer - final asr timer went off');
const evt = this.consolidateTranscripts(this._bufferedTranscripts, 1, this.language, this.vendor);
this._resolve(this._bufferedTranscripts.length > 0 ? 'speech' : 'timeout', evt);
}, 1000);
@@ -833,7 +833,7 @@ class TaskGather extends SttTask {
const finished = fsEvent.getHeader('transcription-session-finished');
this.logger.debug({evt, bugname, finished, vendor: this.vendor}, 'Gather:_onTranscription raw transcript');
if (bugname && this.bugname !== bugname) {
this.logger.debug(
this.logger.info(
`Gather:_onTranscription - ignoring transcript from ${bugname} because our bug is ${this.bugname}`);
return;
}
@@ -843,16 +843,16 @@ class TaskGather extends SttTask {
if (this.vendor === 'deepgram' && evt.type === 'UtteranceEnd') {
/* we will only get this when we have set utterance_end_ms */
if (this._bufferedTranscripts.length === 0) {
this.logger.debug('Gather:_onTranscription - got UtteranceEnd event from deepgram but no buffered transcripts');
this.logger.info('Gather:_onTranscription - got UtteranceEnd event from deepgram but no buffered transcripts');
}
else {
const utteranceTime = evt.last_word_end;
// eslint-disable-next-line max-len
if (utteranceTime && this._dgTimeOfLastUnprocessedWord && utteranceTime < this._dgTimeOfLastUnprocessedWord && utteranceTime != -1) {
this.logger.debug('Gather:_onTranscription - got UtteranceEnd with unprocessed words, continue listening');
this.logger.info('Gather:_onTranscription - got UtteranceEnd with unprocessed words, continue listening');
}
else {
this.logger.debug('Gather:_onTranscription - got UtteranceEnd from deepgram, return buffered transcript');
this.logger.info('Gather:_onTranscription - got UtteranceEnd from deepgram, return buffered transcript');
evt = this.consolidateTranscripts(this._bufferedTranscripts, 1, this.language, this.vendor);
this._bufferedTranscripts = [];
this._resolve('speech', evt);
@@ -1208,7 +1208,7 @@ class TaskGather extends SttTask {
}
async _resolve(reason, evt) {
this.logger.debug(`TaskGather:resolve with reason ${reason}`);
this.logger.info({evt}, `TaskGather:resolve with reason ${reason}`);
if (this.needsStt && this.ep && this.ep.connected) {
this.ep.stopTranscription({
vendor: this.vendor,
@@ -1244,7 +1244,7 @@ class TaskGather extends SttTask {
});
if (this.callSession && this.callSession.callGone) {
this.logger.debug('TaskGather:_resolve - call is gone, not invoking web callback');
this.logger.info('TaskGather:_resolve - call is gone, not invoking web callback');
this.notifyTaskDone();
return;
}