@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.
@@ -1,4 +1,4 @@
1
1
  import Step from '@onereach/flow-sdk/dst/step';
2
- export default class VoiceAgentFunctionResponse extends Step {
2
+ export default class VoiceAgentFunctionResult extends Step {
3
3
  runStep(): Promise<void>;
4
4
  }
@@ -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 VoiceAgentFunctionResponse extends step_1.default {
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 Response: missing call context (must be placed on a Voice Agent function exit)');
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 Response Params", ctx);
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: 'function_result', params: { name: functionName, functionId, result } }]
19
+ commands: [{ name: 'agentFunctionResult', params: { name: functionName, functionId, result } }]
20
20
  }
21
21
  };
22
- this.log.error("Voice Agent Function Response", event);
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 = VoiceAgentFunctionResponse;
31
+ exports.default = VoiceAgentFunctionResult;
@@ -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: 'ws_pipe', params: { url, config } }]);
55
+ await this.sendCommands(call, [{ name: 'startAgent', params: { url, config } }]);
56
56
  return this.exitFlow();
57
57
  });
58
58
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/step-voice",
3
- "version": "7.0.21-voiceagent.21",
3
+ "version": "7.0.21-voiceagent.23",
4
4
  "author": "Roman Zolotarov <roman.zolotarov@onereach.com>",
5
5
  "contributors": [
6
6
  "Roman Zolotarov",