@personaai/runtime 0.7.0 → 0.7.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.
- package/dist/index.cjs +4 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -116,6 +116,8 @@ interface MemoryWriteContext {
|
|
|
116
116
|
interface VoiceSessionCreateContext {
|
|
117
117
|
userId: string;
|
|
118
118
|
agentId: string;
|
|
119
|
+
/** Set when the session resumed an existing conversation (optional `threadId` on the request). */
|
|
120
|
+
threadId?: string;
|
|
119
121
|
}
|
|
120
122
|
/**
|
|
121
123
|
* Lifecycle hooks — the host application's voice inside the runtime's
|
package/dist/index.d.ts
CHANGED
|
@@ -116,6 +116,8 @@ interface MemoryWriteContext {
|
|
|
116
116
|
interface VoiceSessionCreateContext {
|
|
117
117
|
userId: string;
|
|
118
118
|
agentId: string;
|
|
119
|
+
/** Set when the session resumed an existing conversation (optional `threadId` on the request). */
|
|
120
|
+
threadId?: string;
|
|
119
121
|
}
|
|
120
122
|
/**
|
|
121
123
|
* Lifecycle hooks — the host application's voice inside the runtime's
|
package/dist/index.js
CHANGED
|
@@ -719,10 +719,12 @@ var resetThread = async (_request, ctx) => {
|
|
|
719
719
|
var createVoiceSession = async (request, ctx) => {
|
|
720
720
|
const body = requireBodyObject(request.body);
|
|
721
721
|
const agentId = requireStringField(body, "agentId");
|
|
722
|
-
const
|
|
722
|
+
const threadId = typeof body.threadId === "string" && body.threadId ? body.threadId : void 0;
|
|
723
|
+
const ticket = await ctx.client.voice.createSession(agentId, threadId ? { threadId } : {});
|
|
723
724
|
await ctx.hooks?.onVoiceSessionCreate?.({
|
|
724
725
|
userId: request.userId,
|
|
725
|
-
agentId
|
|
726
|
+
agentId,
|
|
727
|
+
threadId
|
|
726
728
|
});
|
|
727
729
|
return json(201, ticket);
|
|
728
730
|
};
|