From f5a5c14ecfc9b11915f473ef69d43ccd0bace93d Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Mon, 29 Dec 2025 23:37:57 +0000 Subject: fix: change prompt to better recognize error pages --- packages/shared/prompts.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'packages') diff --git a/packages/shared/prompts.ts b/packages/shared/prompts.ts index 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} -- cgit v1.2.3-70-g09d2