mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 12:55:00 +00:00
@@ -152,6 +152,22 @@ export async function createRandomUser(): Promise<{
|
||||
} as any;
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
await client.aiPrompt.update({
|
||||
where: { id: promptId },
|
||||
data: { model },
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export async function createRandomAIUser(): Promise<{
|
||||
name: string;
|
||||
email: string;
|
||||
|
||||
Reference in New Issue
Block a user