Open
Description
following a thread on the convex discord, using the components.agent.streams.finish
doesn't end the stream immediately, and using the AbortController
doesn't end the stream too.
export const stopStreaming = action({Add commentMore actions
args: { threadId: v.string() },
handler: async (ctx, args_0) => {
// Not properly working
const data = await ctx.runQuery(components.agent.streams.list, { threadId: args_0.threadId })
if (data[0]) {
console.log("I ran", data[0].streamId)
await ctx.runMutation(components.agent.streams.finish, {
streamId: data?.[0]?.streamId
})
} else {
console.log("none are running right now")
}
}
})
Metadata
Metadata
Assignees
Labels
No labels