@onereach/step-voice 7.0.26-agenttimeout.4 → 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 -10
- 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 updated', 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,7 +111,7 @@ 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;
|
|
@@ -172,19 +171,21 @@ class VoiceAgent extends voice_1.default {
|
|
|
172
171
|
this.log.warn('Voice Agent: invalid tool_feedback.delay_seconds — feedback config excluded');
|
|
173
172
|
return undefined;
|
|
174
173
|
}
|
|
175
|
-
// Validate pre_tool_speech_phrases
|
|
174
|
+
// Validate pre_tool_speech_phrases (only required when mode is 'static')
|
|
176
175
|
const phrases = cfg.pre_tool_speech_phrases;
|
|
177
|
-
if (
|
|
178
|
-
phrases
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
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
|
+
}
|
|
183
184
|
}
|
|
184
185
|
return {
|
|
185
186
|
enabled: true,
|
|
186
187
|
pre_tool_speech: cfg.pre_tool_speech,
|
|
187
|
-
pre_tool_speech_phrases: phrases,
|
|
188
|
+
pre_tool_speech_phrases: (Array.isArray(phrases) ? phrases : []),
|
|
188
189
|
tool_call_sound: cfg.tool_call_sound,
|
|
189
190
|
tool_call_sound_behavior: cfg.tool_call_sound_behavior,
|
|
190
191
|
delay_seconds: delay
|