@onereach/step-voice 7.0.26-agenttimeout.6 → 7.0.26-agenttimeout.7
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.
|
@@ -4,9 +4,12 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const voice_1 = tslib_1.__importDefault(require("./voice"));
|
|
5
5
|
class VoiceAgentFunctionResult extends voice_1.default {
|
|
6
6
|
async runStep() {
|
|
7
|
-
const ctx = await this.thread.get('__voiceAgentContext') ?? {};
|
|
8
|
-
const { callId, callCallback, name: functionName, functionId } = ctx;
|
|
9
7
|
const { result, stopAgent } = this.data;
|
|
8
|
+
let ctx = await this.thread.get(`__voiceAgentContext_${this.thread.id}`);
|
|
9
|
+
if (!ctx) {
|
|
10
|
+
ctx = await this.thread.get('__voiceAgentContext') ?? {};
|
|
11
|
+
}
|
|
12
|
+
const { callId, callCallback, name: functionName, functionId } = ctx;
|
|
10
13
|
if (!callId) {
|
|
11
14
|
throw new Error('Voice Agent Function Result: missing call context (must be placed on a Voice Agent function exit)');
|
|
12
15
|
}
|
package/dst/Voice Agent.js
CHANGED
|
@@ -296,8 +296,10 @@ class VoiceAgent extends voice_1.default {
|
|
|
296
296
|
return options;
|
|
297
297
|
}
|
|
298
298
|
async exitToThread() {
|
|
299
|
-
|
|
300
|
-
this.thread.
|
|
299
|
+
const result = this.state.result;
|
|
300
|
+
await this.thread.set(`__voiceAgentContext_${this.thread.id}`, result);
|
|
301
|
+
await this.thread.set('__voiceAgentContext', result);
|
|
302
|
+
this.thread.exitStep(this.state.exitStep, result);
|
|
301
303
|
}
|
|
302
304
|
}
|
|
303
305
|
exports.default = VoiceAgent;
|