@onereach/step-voice 7.0.28-addmissingagentdtmfui.0 → 7.0.28
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/Voice Agent.d.ts +7 -0
- package/dst/Voice Agent.js +10 -1
- package/package.json +1 -1
package/dst/Voice Agent.d.ts
CHANGED
|
@@ -30,6 +30,11 @@ interface Handler {
|
|
|
30
30
|
parameters: string;
|
|
31
31
|
feedback?: PerToolConfig;
|
|
32
32
|
}
|
|
33
|
+
interface AgentSystemToolConfig {
|
|
34
|
+
name: string;
|
|
35
|
+
description?: string;
|
|
36
|
+
parameters?: Record<string, unknown>;
|
|
37
|
+
}
|
|
33
38
|
interface AgentServiceConfig {
|
|
34
39
|
provider: string;
|
|
35
40
|
model: string;
|
|
@@ -63,6 +68,7 @@ interface INPUT {
|
|
|
63
68
|
realtime: Partial<AgentServiceConfig>;
|
|
64
69
|
tool_feedback?: ToolCallFeedbackConfig;
|
|
65
70
|
soft_timeout?: SoftTimeoutConfig;
|
|
71
|
+
system_tools?: AgentSystemToolConfig[];
|
|
66
72
|
}
|
|
67
73
|
export default class VoiceAgent extends VoiceStep<Partial<INPUT>> {
|
|
68
74
|
runStep(): Promise<void>;
|
|
@@ -74,6 +80,7 @@ export default class VoiceAgent extends VoiceStep<Partial<INPUT>> {
|
|
|
74
80
|
private buildAgentServiceConfig;
|
|
75
81
|
private validatePerToolFeedback;
|
|
76
82
|
private validateSoftTimeout;
|
|
83
|
+
private validateSystemTools;
|
|
77
84
|
private parseAgentServiceOptions;
|
|
78
85
|
exitToThread(): Promise<void>;
|
|
79
86
|
}
|
package/dst/Voice Agent.js
CHANGED
|
@@ -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 = '', 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;
|
|
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, system_tools, 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
|
}
|
|
@@ -134,6 +134,9 @@ class VoiceAgent extends voice_1.default {
|
|
|
134
134
|
config.soft_timeout = validatedSoftTimeout;
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
|
+
if (system_tools != null) {
|
|
138
|
+
config.system_tools = this.validateSystemTools(system_tools);
|
|
139
|
+
}
|
|
137
140
|
const params = { config };
|
|
138
141
|
if (agentCustomUrl) {
|
|
139
142
|
params.url = agentCustomUrl;
|
|
@@ -290,6 +293,12 @@ class VoiceAgent extends voice_1.default {
|
|
|
290
293
|
mode: cfg.mode
|
|
291
294
|
};
|
|
292
295
|
}
|
|
296
|
+
validateSystemTools(systemTools) {
|
|
297
|
+
if (!Array.isArray(systemTools)) {
|
|
298
|
+
this.throwError(new Error('Voice Agent: system_tools must be an array'));
|
|
299
|
+
}
|
|
300
|
+
return systemTools.filter(entry => entry != null && typeof entry === 'object');
|
|
301
|
+
}
|
|
293
302
|
parseAgentServiceOptions(label, options) {
|
|
294
303
|
if (options == null || options === '')
|
|
295
304
|
return undefined;
|