diff options
Diffstat (limited to 'packages/trpc/routers/bookmarks.ts')
| -rw-r--r-- | packages/trpc/routers/bookmarks.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/packages/trpc/routers/bookmarks.ts b/packages/trpc/routers/bookmarks.ts index 026bd322..f7f8e6b7 100644 --- a/packages/trpc/routers/bookmarks.ts +++ b/packages/trpc/routers/bookmarks.ts @@ -19,6 +19,7 @@ import { bookmarksInLists, bookmarkTags, bookmarkTexts, + customPrompts, rssFeedImportsTable, tagsOnBookmarks, } from "@hoarder/db/schema"; @@ -1191,8 +1192,19 @@ Description: ${bookmark.description ?? ""} Content: ${bookmark.content ?? ""} `; + const prompts = await ctx.db.query.customPrompts.findMany({ + where: and( + eq(customPrompts.userId, ctx.user.id), + eq(customPrompts.appliesTo, "summary"), + ), + columns: { + text: true, + }, + }); + const summaryPrompt = buildSummaryPrompt( serverConfig.inference.inferredTagLang, + prompts.map((p) => p.text), bookmarkDetails, serverConfig.inference.contextLength, ); |
