@onereach/step-voice 7.0.21-voiceagent.21 → 7.0.21-voiceagent.23
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.
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const step_1 = tslib_1.__importDefault(require("@onereach/flow-sdk/dst/step"));
|
|
5
|
-
class
|
|
5
|
+
class VoiceAgentFunctionResult extends step_1.default {
|
|
6
6
|
async runStep() {
|
|
7
7
|
const ctx = await this.thread.get('__voiceAgentContext') ?? {};
|
|
8
8
|
const { callId, callCallback, name: functionName, functionId } = ctx;
|
|
9
9
|
const result = this.data.result ?? '';
|
|
10
10
|
if (!callId) {
|
|
11
|
-
throw new Error('Voice Agent Function
|
|
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.error("Voice Agent Function
|
|
13
|
+
this.log.error("Voice Agent Function Result Params", ctx);
|
|
14
14
|
const event = {
|
|
15
15
|
target: this.helpers.providersAccountId,
|
|
16
|
-
name: 'out/voice/function-result',
|
|
16
|
+
name: 'out/voice/agent-function-result',
|
|
17
17
|
params: {
|
|
18
18
|
id: callId,
|
|
19
|
-
commands: [{ name: '
|
|
19
|
+
commands: [{ name: 'agentFunctionResult', params: { name: functionName, functionId, result } }]
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
|
-
this.log.error("Voice Agent Function
|
|
22
|
+
this.log.error("Voice Agent Function Result", event);
|
|
23
23
|
await this.thread.eventManager.emit(event, {
|
|
24
24
|
target: callCallback,
|
|
25
25
|
invocationType: 'async',
|
|
@@ -28,4 +28,4 @@ class VoiceAgentFunctionResponse extends step_1.default {
|
|
|
28
28
|
this.exitStep('next');
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
exports.default =
|
|
31
|
+
exports.default = VoiceAgentFunctionResult;
|
package/dst/Voice Agent.js
CHANGED
|
@@ -52,7 +52,7 @@ class VoiceAgent extends voice_1.default {
|
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
this.triggers.otherwise(async () => {
|
|
55
|
-
await this.sendCommands(call, [{ name: '
|
|
55
|
+
await this.sendCommands(call, [{ name: 'startAgent', params: { url, config } }]);
|
|
56
56
|
return this.exitFlow();
|
|
57
57
|
});
|
|
58
58
|
}
|