diff options
| author | Mohamed Bassem <me@mbassem.com> | 2025-12-29 23:37:57 +0000 |
|---|---|---|
| committer | Mohamed Bassem <me@mbassem.com> | 2025-12-29 23:38:21 +0000 |
| commit | f5a5c14ecfc9b11915f473ef69d43ccd0bace93d (patch) | |
| tree | 13ae1b92d3343ba294f3e14ba0a91525f56c7689 /packages/shared | |
| parent | f00287ede0675521c783c1199675538571f977d6 (diff) | |
| download | karakeep-f5a5c14ecfc9b11915f473ef69d43ccd0bace93d.tar.zst | |
fix: change prompt to better recognize error pages
Diffstat (limited to 'packages/shared')
| -rw-r--r-- | packages/shared/prompts.ts | 9 |
1 files changed, 6 insertions, 3 deletions
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} |
