A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search
fix: change prompt to better recognize error pages
Mohamed Bassemf5a5c14ecfc9
diff --git a/packages/shared/prompts.ts b/packages/shared/prompts.tsindex af2f07f1..bc130b2c 100644--- a/packages/shared/prompts.ts+++ b/packages/shared/prompts.ts@@ -52,7 +52,7 @@ export function buildImagePrompt(return `You are an expert whose responsibility is to help with automatic text tagging for a read-it-later/bookmarking app.-Please analyze the attached image and suggest relevant tags that describe its key themes, topics, and main ideas. The rules are:+Analyze the attached image and suggest relevant tags that describe its key themes, topics, and main ideas. The rules are:- Aim for a variety of tags, including broad categories, specific keywords, and potential sub-genres.- The tags must be in ${lang}.- If the tag is not generic enough, don't include it.@@ -76,11 +76,14 @@ function constructTextTaggingPrompt(return `You are an expert whose responsibility is to help with automatic tagging for a read-it-later/bookmarking app.-Please analyze the TEXT_CONTENT below and suggest relevant tags that describe its key themes, topics, and main ideas. The rules are:+Analyze the TEXT_CONTENT below and suggest relevant tags that describe its key themes, topics, and main ideas. The rules are:- Aim for a variety of tags, including broad categories, specific keywords, and potential sub-genres.- The tags must be in ${lang}.- If the tag is not generic enough, don't include it.-- The content can include text for cookie consent and privacy policy, ignore those while tagging.+- Return empty tags if the content is:+ - An error page (404, 403, blocked, not found)+ - Mostly boilerplate (cookie consent, login walls, GDPR notices)+ - Garbled, truncated, or nonsensical- Aim for 3-5 tags.- If there are no good tags, leave the array empty.${tagStyleInstruction}