chat: remember last model

This commit is contained in:
2026-02-14 22:06:30 -08:00
parent a76b4ba232
commit fb306e154a
8 changed files with 173 additions and 9 deletions

View File

@@ -29,6 +29,23 @@ export async function* runMultiplexStream(req: MultiplexRequest): AsyncGenerator
select: { id: true },
});
await prisma.$transaction([
prisma.chat.update({
where: { id: chatId },
data: {
lastUsedProvider: req.provider as any,
lastUsedModel: req.model,
},
}),
prisma.chat.updateMany({
where: { id: chatId, initiatedProvider: null },
data: {
initiatedProvider: req.provider as any,
initiatedModel: req.model,
},
}),
]);
yield { type: "meta", chatId, callId: call.id, provider: req.provider, model: req.model };
let text = "";