@onereach/step-voice 7.0.26-agenttimeout.3 → 7.0.26-agenttimeout.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/Voice Agent.js +11 -12
- package/package.json +1 -1
package/dst/Voice Agent.js
CHANGED
|
@@ -43,7 +43,6 @@ class VoiceAgent extends voice_1.default {
|
|
|
43
43
|
});
|
|
44
44
|
this.triggers.otherwise(async () => {
|
|
45
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;
|
|
46
|
-
this.log.warn('this.data', this.data);
|
|
47
46
|
if (lodash_1.default.isEmpty(system_instruction)) {
|
|
48
47
|
this.throwError(new Error('Voice Agent: system instruction is required'));
|
|
49
48
|
}
|
|
@@ -112,20 +111,18 @@ class VoiceAgent extends voice_1.default {
|
|
|
112
111
|
this.throwError(new Error(`Voice Agent: unknown mode "${mode}"`));
|
|
113
112
|
}
|
|
114
113
|
}
|
|
115
|
-
if (this.isStepFlagEnabled(tool_feedback?.enabled)) {
|
|
114
|
+
if (this.isStepFlagEnabled(tool_feedback?.enabled) && tools.length > 0) {
|
|
116
115
|
const validatedFeedback = this.validateToolFeedback(tool_feedback);
|
|
117
116
|
if (validatedFeedback) {
|
|
118
117
|
config.tool_feedback = validatedFeedback;
|
|
119
118
|
}
|
|
120
119
|
}
|
|
121
|
-
this.log.warn('tool_feedback', tool_feedback);
|
|
122
120
|
if (soft_timeout != null) {
|
|
123
121
|
const validatedSoftTimeout = this.validateSoftTimeout(soft_timeout);
|
|
124
122
|
if (validatedSoftTimeout) {
|
|
125
123
|
config.soft_timeout = validatedSoftTimeout;
|
|
126
124
|
}
|
|
127
125
|
}
|
|
128
|
-
this.log.warn('soft_timeout', soft_timeout);
|
|
129
126
|
const params = { config };
|
|
130
127
|
if (agentCustomUrl) {
|
|
131
128
|
params.url = agentCustomUrl;
|
|
@@ -174,19 +171,21 @@ class VoiceAgent extends voice_1.default {
|
|
|
174
171
|
this.log.warn('Voice Agent: invalid tool_feedback.delay_seconds — feedback config excluded');
|
|
175
172
|
return undefined;
|
|
176
173
|
}
|
|
177
|
-
// Validate pre_tool_speech_phrases
|
|
174
|
+
// Validate pre_tool_speech_phrases (only required when mode is 'static')
|
|
178
175
|
const phrases = cfg.pre_tool_speech_phrases;
|
|
179
|
-
if (
|
|
180
|
-
phrases
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
176
|
+
if (cfg.pre_tool_speech === 'static') {
|
|
177
|
+
if (!Array.isArray(phrases) ||
|
|
178
|
+
phrases.length < 1 ||
|
|
179
|
+
phrases.length > 20 ||
|
|
180
|
+
!phrases.every((p) => typeof p === 'string' && p.trim().length > 0)) {
|
|
181
|
+
this.log.warn('Voice Agent: invalid tool_feedback.pre_tool_speech_phrases — feedback config excluded');
|
|
182
|
+
return undefined;
|
|
183
|
+
}
|
|
185
184
|
}
|
|
186
185
|
return {
|
|
187
186
|
enabled: true,
|
|
188
187
|
pre_tool_speech: cfg.pre_tool_speech,
|
|
189
|
-
pre_tool_speech_phrases: phrases,
|
|
188
|
+
pre_tool_speech_phrases: (Array.isArray(phrases) ? phrases : []),
|
|
190
189
|
tool_call_sound: cfg.tool_call_sound,
|
|
191
190
|
tool_call_sound_behavior: cfg.tool_call_sound_behavior,
|
|
192
191
|
delay_seconds: delay
|