streaming, markdown, model selecting, and lots more

This commit is contained in:
Zoe
2026-02-02 23:16:06 -06:00
parent 8c28946703
commit d5a5945c03
114 changed files with 6109 additions and 2938 deletions
@@ -0,0 +1,27 @@
import { httpClient } from '~~/server/lib/triplit';
import { cancelPendingGeneration } from '~~/server/utils/generations';
export default defineEventHandler(async (event) => {
await protectRoute(event);
const { generationId } = event.context.params!;
const success = cancelPendingGeneration(generationId!);
if (!success) {
const generation = await httpClient.fetchOne(httpClient.query('generations').Where('id', '=', generationId!));
if (generation !== null && generation.status === 'pending') {
await httpClient.update('generations', generationId!, {
status: 'cancelled',
});
return;
}
throw createError({
statusCode: 400,
message: 'Generation not found or already completed',
});
}
return;
});