feat(server): use faster model in ci test (#13038)

fix AI-329
This commit is contained in:
DarkSky
2025-07-09 22:21:30 +08:00
committed by GitHub
parent 38537bf310
commit c4c11da976
17 changed files with 121 additions and 61 deletions

View File

@@ -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;