@onereach/step-voice 7.0.26-agenttimeout.13 → 7.0.26-agenttimeout.14

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.
@@ -49,6 +49,10 @@ interface INPUT {
49
49
  prompt?: string;
50
50
  }>;
51
51
  idle_goodbye_message: string;
52
+ dtmf_enabled: boolean;
53
+ dtmf_timeout: number | string;
54
+ dtmf_termination_digit: string;
55
+ dtmf_prefix: string;
52
56
  custom_config_enabled: boolean;
53
57
  agent_url_overwritten: boolean;
54
58
  agent_url: string;
@@ -42,7 +42,7 @@ class VoiceAgent extends voice_1.default {
42
42
  }
43
43
  });
44
44
  this.triggers.otherwise(async () => {
45
- const { handlers = [], system_instruction = '', developer_messages = [], greeting_message = '', prevent_greeting_interruption = false, idle_detection_enabled = false, idle_timeout_secs = 8, idle_max_retries = 3, idle_prompts = [], idle_goodbye_message = '', custom_config_enabled = false, agent_url_overwritten = false, tool_feedback, soft_timeout, agent_url = '', mode = '', stt = {}, llm = {}, tts = {}, realtime = {} } = this.data;
45
+ const { handlers = [], system_instruction = '', developer_messages = [], greeting_message = '', prevent_greeting_interruption = false, idle_detection_enabled = false, idle_timeout_secs = 8, idle_max_retries = 3, idle_prompts = [], idle_goodbye_message = '', dtmf_enabled = false, dtmf_timeout = 2, dtmf_termination_digit = '#', dtmf_prefix = 'DTMF: ', custom_config_enabled = false, agent_url_overwritten = false, tool_feedback, soft_timeout, agent_url = '', mode = '', stt = {}, llm = {}, tts = {}, realtime = {} } = this.data;
46
46
  if (lodash_1.default.isEmpty(system_instruction)) {
47
47
  this.throwError(new Error('Voice Agent: system instruction is required'));
48
48
  }
@@ -89,6 +89,17 @@ class VoiceAgent extends voice_1.default {
89
89
  goodbye_message: lodash_1.default.isEmpty(lodash_1.default.trim(idle_goodbye_message)) ? undefined : idle_goodbye_message
90
90
  };
91
91
  }
92
+ if (this.isStepFlagEnabled(dtmf_enabled)) {
93
+ const timeout = Number(dtmf_timeout);
94
+ const terminationDigit = String(dtmf_termination_digit || '#');
95
+ const prefix = dtmf_prefix == null || dtmf_prefix === '' ? 'DTMF: ' : String(dtmf_prefix);
96
+ config.dtmf = {
97
+ enabled: true,
98
+ timeout: Number.isFinite(timeout) ? timeout : 2,
99
+ termination_digit: terminationDigit,
100
+ prefix
101
+ };
102
+ }
92
103
  let agentCustomUrl = '';
93
104
  if (this.isStepFlagEnabled(agent_url_overwritten)) {
94
105
  if (!this.isValidAgentUrl(agent_url)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/step-voice",
3
- "version": "7.0.26-agenttimeout.13",
3
+ "version": "7.0.26-agenttimeout.14",
4
4
  "author": "Roman Zolotarov <roman.zolotarov@onereach.com>",
5
5
  "contributors": [
6
6
  "Roman Zolotarov",