@onereach/step-voice 7.0.2-processttschunk.9 → 7.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dst/Choice.js CHANGED
@@ -102,7 +102,7 @@ class Choice extends voice_1.default {
102
102
  event,
103
103
  speechSections,
104
104
  repromptsList,
105
- reportingSettingsKey
105
+ reportingSettingsKey: this.rptsStarted ? 'transcriptReprompt' : 'transcriptPrompt'
106
106
  });
107
107
  switch (event.params.type) {
108
108
  case 'digit':
@@ -93,7 +93,7 @@ class CustomVoiceInput extends voice_1.default {
93
93
  event,
94
94
  speechSections,
95
95
  repromptsList,
96
- reportingSettingsKey
96
+ reportingSettingsKey: this.rptsStarted ? 'transcriptReprompt' : 'transcriptPrompt'
97
97
  });
98
98
  switch (event.params.type) {
99
99
  // digit recognition removed
@@ -92,7 +92,9 @@ class GlobalCommand extends voice_1.default {
92
92
  await this.initGrammar(call);
93
93
  }
94
94
  if (allowAck) {
95
+ this.log.debug('subscribing gc to ack');
95
96
  this.triggers.local('ack', ({ params: { ack } }) => {
97
+ this.log.debug('gc ack received', { ack });
96
98
  delete worker.state.acktrd;
97
99
  if (ack)
98
100
  this.exitStep('no commands');
@@ -166,6 +168,7 @@ class GlobalCommand extends voice_1.default {
166
168
  this.end();
167
169
  });
168
170
  this.triggers.local(`in/voice/${call.id}`, async (event) => {
171
+ this.log.debug('gc in/voice event', event.params);
169
172
  switch (event.params.type) {
170
173
  case 'ack': {
171
174
  this.acceptAck({ ack: true });
@@ -336,6 +339,7 @@ class GlobalCommand extends voice_1.default {
336
339
  }
337
340
  acceptAck(eventParams) {
338
341
  if (this.state.acktrd) {
342
+ this.log.debug('accepting ack', eventParams);
339
343
  this.process.enqueue({
340
344
  thread: this.state.acktrd,
341
345
  name: 'ack',
@@ -75,7 +75,7 @@ class KeypadInput extends voice_1.default {
75
75
  event,
76
76
  speechSections,
77
77
  repromptsList,
78
- reportingSettingsKey
78
+ reportingSettingsKey: this.rptsStarted ? 'transcriptReprompt' : 'transcriptPrompt'
79
79
  });
80
80
  switch (event.params.type) {
81
81
  case 'digits': {
@@ -22,7 +22,8 @@ class SayMessage extends voice_1.default {
22
22
  await this.handleInterruption({
23
23
  call,
24
24
  event,
25
- speechSections
25
+ speechSections,
26
+ reportingSettingsKey: 'transcript'
26
27
  });
27
28
  switch (event.params.type) {
28
29
  case 'hangup':
package/dst/voice.js CHANGED
@@ -417,7 +417,7 @@ class VoiceStep extends step_1.default {
417
417
  if (!interruptionMetadata)
418
418
  return;
419
419
  const sections = [];
420
- if (repromptsList.length && reportingSettingsKey === 'transcriptRepromptResponse') {
420
+ if (repromptsList.length && reportingSettingsKey === 'transcriptReprompt') {
421
421
  const current = repromptsList[this.rptsIndex - 1];
422
422
  sections.push({
423
423
  url: current?.fileName,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/step-voice",
3
- "version": "7.0.2-processttschunk.9",
3
+ "version": "7.0.5",
4
4
  "author": "Roman Zolotarov <roman.zolotarov@onereach.com>",
5
5
  "contributors": [
6
6
  "Roman Zolotarov",
@@ -1,12 +0,0 @@
1
- import VoiceStep, { VoiceEvent } from './voice';
2
- interface INPUT {
3
- textChunk: string;
4
- isFinal: boolean;
5
- }
6
- interface EVENT extends VoiceEvent {
7
- exitId?: string;
8
- }
9
- export default class ProcessTtsChunk extends VoiceStep<INPUT, {}, EVENT> {
10
- runStep(): Promise<void>;
11
- }
12
- export {};
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const voice_1 = tslib_1.__importDefault(require("./voice"));
5
- class ProcessTtsChunk extends voice_1.default {
6
- async runStep() {
7
- const call = await this.fetchData();
8
- const { textChunk, isFinal } = this.data;
9
- const command = {
10
- name: 'process-tts-chunk',
11
- params: {
12
- chunk: textChunk,
13
- isFinal
14
- }
15
- };
16
- this.triggers.local(`in/voice/${call.id}`, async (event) => {
17
- this.log.info('Received event from voicer', event);
18
- });
19
- this.triggers.otherwise(async () => {
20
- await this.sendCommands({ ...call, type: 'tts-chunk' }, [command]);
21
- this.exitStep('next');
22
- });
23
- }
24
- }
25
- exports.default = ProcessTtsChunk;
@@ -1,12 +0,0 @@
1
- import VoiceStep, { TODO, VoiceEvent } from './voice';
2
- interface INPUT {
3
- voiceId: string;
4
- infiniteProcessing: boolean;
5
- asr: TODO;
6
- }
7
- interface EVENT extends VoiceEvent {
8
- }
9
- export default class StartTTSChunksProcessing extends VoiceStep<INPUT, {}, EVENT> {
10
- runStep(): Promise<void>;
11
- }
12
- export {};
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const voice_1 = tslib_1.__importDefault(require("./voice"));
5
- class StartTTSChunksProcessing extends voice_1.default {
6
- async runStep() {
7
- const call = await this.fetchData();
8
- const { voiceId, infiniteProcessing, asr } = this.data;
9
- const grammar = {
10
- id: this.currentStepId,
11
- asr: asr.getSettings(call.asr),
12
- };
13
- const command = {
14
- name: 'start-TTS-chunks-processing',
15
- params: {
16
- voiceId,
17
- infiniteProcessing,
18
- grammar
19
- }
20
- };
21
- this.triggers.local(`in/voice/${call.id}`, async (event) => {
22
- this.log.info('Received event from voicer', event);
23
- });
24
- this.triggers.otherwise(async () => {
25
- await this.pauseRecording(call, command);
26
- return this.exitFlow();
27
- });
28
- }
29
- }
30
- exports.default = StartTTSChunksProcessing;