mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-14 08:36:22 +08:00
feat(server): refactor copilot (#14892)
#### PR Dependency Tree * **PR #14892** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal)
This commit is contained in:
@@ -154,15 +154,14 @@ export async function cleanupWorkspace(workspaceId: string): Promise<void> {
|
||||
|
||||
export async function switchDefaultChatModel(model: string) {
|
||||
await runPrisma(async client => {
|
||||
const promptId = await client.aiPrompt
|
||||
.findFirst({
|
||||
where: { name: 'Chat With AFFiNE AI' },
|
||||
select: { id: true },
|
||||
})
|
||||
.then(f => f!.id);
|
||||
const prompt = await client.aiPrompt.findFirst({
|
||||
where: { name: 'Chat With AFFiNE AI' },
|
||||
select: { id: true },
|
||||
});
|
||||
if (!prompt) return;
|
||||
|
||||
await client.aiPrompt.update({
|
||||
where: { id: promptId },
|
||||
where: { id: prompt.id },
|
||||
data: { model },
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user