Skip to content

A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search

fix: use user's preferred language for manual summarization (#2429)

Mohamed Bassem95bfa5691ce0
diff --git a/packages/trpc/routers/bookmarks.ts b/packages/trpc/routers/bookmarks.ts
index 37497bcf..5a39439f 100644
--- a/packages/trpc/routers/bookmarks.ts
+++ b/packages/trpc/routers/bookmarks.ts
@@ -14,6 +14,7 @@ import {
bookmarkTexts,
customPrompts,
tagsOnBookmarks,
+ users,
} from "@karakeep/db/schema";
import {
AssetPreprocessingQueue,
@@ -988,8 +989,15 @@ Author: ${bookmark.author ?? ""}
},
});
+ const userSettings = await ctx.db.query.users.findFirst({
+ where: eq(users.id, ctx.user.id),
+ columns: {
+ inferredTagLang: true,
+ },
+ });
+
const summaryPrompt = await buildSummaryPrompt(
- serverConfig.inference.inferredTagLang,
+ userSettings?.inferredTagLang ?? serverConfig.inference.inferredTagLang,
prompts.map((p) => p.text),
bookmarkDetails,
serverConfig.inference.contextLength,