@onereach/step-voice 7.0.23-VOIC1697agentconfigstep.0 → 7.0.23-voiceagent.1
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.
|
@@ -10,7 +10,7 @@ class VoiceAgentFunctionResult extends voice_1.default {
|
|
|
10
10
|
if (!callId) {
|
|
11
11
|
throw new Error('Voice Agent Function Result: missing call context (must be placed on a Voice Agent function exit)');
|
|
12
12
|
}
|
|
13
|
-
this.log.
|
|
13
|
+
this.log.info("Voice Agent Function Result Params", ctx);
|
|
14
14
|
const params = {
|
|
15
15
|
functionName: functionName,
|
|
16
16
|
functionId: functionId,
|
package/dst/Voice Agent.d.ts
CHANGED
|
@@ -14,12 +14,9 @@ interface INPUT {
|
|
|
14
14
|
handlers: Handler[];
|
|
15
15
|
system_instruction: string;
|
|
16
16
|
developer_messages: string[];
|
|
17
|
-
greeting_message: string;
|
|
18
|
-
prevent_greeting_interruption: boolean;
|
|
19
17
|
custom_config_enabled: boolean;
|
|
20
18
|
agent_url_overwritten: boolean;
|
|
21
19
|
agent_url: string;
|
|
22
|
-
ssl_enabled: boolean;
|
|
23
20
|
mode: string;
|
|
24
21
|
stt: Partial<AgentServiceConfig>;
|
|
25
22
|
llm: Partial<AgentServiceConfig>;
|
package/dst/Voice Agent.js
CHANGED
|
@@ -34,7 +34,7 @@ class VoiceAgent extends voice_1.default {
|
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
this.triggers.otherwise(async () => {
|
|
37
|
-
const { handlers = [], system_instruction = '', developer_messages = [],
|
|
37
|
+
const { handlers = [], system_instruction = '', developer_messages = [], custom_config_enabled = false, agent_url_overwritten = false, agent_url = '', mode = '', stt = {}, llm = {}, tts = {}, realtime = {} } = this.data;
|
|
38
38
|
const tools = handlers.map(h => {
|
|
39
39
|
let parameters = h.parameters;
|
|
40
40
|
if (typeof parameters === 'string') {
|
|
@@ -50,18 +50,16 @@ class VoiceAgent extends voice_1.default {
|
|
|
50
50
|
const config = {
|
|
51
51
|
system_instruction,
|
|
52
52
|
developer_messages,
|
|
53
|
-
greeting_message,
|
|
54
|
-
prevent_greeting_interruption,
|
|
55
53
|
tools
|
|
56
54
|
};
|
|
57
|
-
let agentCustomUrl;
|
|
55
|
+
let agentCustomUrl = '';
|
|
58
56
|
if (custom_config_enabled) {
|
|
59
57
|
config.mode = mode;
|
|
60
58
|
if (agent_url_overwritten) {
|
|
61
59
|
if (!this.isValidAgentUrl(agent_url)) {
|
|
62
60
|
this.throwError(new Error(`Voice Agent: invalid agent url "${agent_url}"`));
|
|
63
61
|
}
|
|
64
|
-
agentCustomUrl =
|
|
62
|
+
agentCustomUrl = agent_url;
|
|
65
63
|
}
|
|
66
64
|
switch (mode) {
|
|
67
65
|
case "waterfall" /* AgentPipelineMode.WATERFALL */:
|
|
@@ -89,9 +87,7 @@ class VoiceAgent extends voice_1.default {
|
|
|
89
87
|
return exit?.id;
|
|
90
88
|
}
|
|
91
89
|
isValidAgentUrl(value) {
|
|
92
|
-
|
|
93
|
-
return true;
|
|
94
|
-
return /^([a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*|\[[a-fA-F0-9:]+\])(:\d+)?$/.test(value);
|
|
90
|
+
return /^wss?:\/\/([a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)+|\[[a-fA-F0-9:]+\])(:\d+)?(\/\S*)?$/.test(value);
|
|
95
91
|
}
|
|
96
92
|
buildAgentServiceConfig(label, service) {
|
|
97
93
|
if (lodash_1.default.isEmpty(service.provider))
|