log gather payload at info

This commit is contained in:
Dave Horton
2025-01-14 14:40:03 -05:00
parent 2bf4fb906b
commit d484771455

View File

@@ -1137,15 +1137,18 @@ class TaskGather extends SttTask {
if (this.parentTask) this.parentTask.emit('dtmf', evt); if (this.parentTask) this.parentTask.emit('dtmf', evt);
else { else {
this.emit('dtmf', evt); this.emit('dtmf', evt);
returnedVerbs = await this.performAction({digits: this.digitBuffer, reason: 'dtmfDetected'}); const payload = {digits: this.digitBuffer, reason: 'dtmfDetected'};
this.logger.info({payload}, 'TaskGather:_resolve - sending dtmf event to app');
returnedVerbs = await this.performAction(payload);
} }
} }
else if (reason.startsWith('speech')) { else if (reason.startsWith('speech')) {
if (this.parentTask) this.parentTask.emit('transcription', evt); if (this.parentTask) this.parentTask.emit('transcription', evt);
else { else {
this.emit('transcription', evt); this.emit('transcription', evt);
this.logger.debug('TaskGather:_resolve - invoking performAction'); const payload = {speech: evt, reason: 'speechDetected'};
returnedVerbs = await this.performAction({speech: evt, reason: 'speechDetected'}); this.logger.info({payload}, 'TaskGather:_resolve - sending speech transcript to app');
returnedVerbs = await this.performAction(payload);
this.logger.debug({returnedVerbs}, 'TaskGather:_resolve - back from performAction'); this.logger.debug({returnedVerbs}, 'TaskGather:_resolve - back from performAction');
} }
} }
@@ -1153,6 +1156,7 @@ class TaskGather extends SttTask {
if (this.parentTask) this.parentTask.emit('timeout', evt); if (this.parentTask) this.parentTask.emit('timeout', evt);
else { else {
this.emit('timeout', evt); this.emit('timeout', evt);
this.logger.info('TaskGather:_resolve - sending timeout event to app');
returnedVerbs = await this.performAction({reason: 'timeout'}); returnedVerbs = await this.performAction({reason: 'timeout'});
} }
} }
@@ -1160,12 +1164,15 @@ class TaskGather extends SttTask {
if (this.parentTask) this.parentTask.emit('stt-error', evt); if (this.parentTask) this.parentTask.emit('stt-error', evt);
else { else {
this.emit('stt-error', evt); this.emit('stt-error', evt);
returnedVerbs = await this.performAction({reason: 'error', details: evt.error}); const payload = {reason: 'stt-error', details: evt.error};
this.logger.info({payload}, 'TaskGather:_resolve - sending stt-error event to app');
returnedVerbs = await this.performAction(payload);
} }
} else if (reason.startsWith('stt-low-confidence')) { } else if (reason.startsWith('stt-low-confidence')) {
if (this.parentTask) this.parentTask.emit('stt-low-confidence', evt); if (this.parentTask) this.parentTask.emit('stt-low-confidence', evt);
else { else {
this.emit('stt-low-confidence', evt); this.emit('stt-low-confidence', evt);
this.logger.info('TaskGather:_resolve - sending stt-low-confidence event to app');
returnedVerbs = await this.performAction({reason: 'stt-low-confidence'}); returnedVerbs = await this.performAction({reason: 'stt-low-confidence'});
} }
} }