diff options
Diffstat (limited to 'packages/shared/prompts.ts')
| -rw-r--r-- | packages/shared/prompts.ts | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/packages/shared/prompts.ts b/packages/shared/prompts.ts new file mode 100644 index 00000000..cf6d48b6 --- /dev/null +++ b/packages/shared/prompts.ts @@ -0,0 +1,33 @@ +export function buildImagePrompt(lang: string, customPrompts: string[]) { + return ` +You are a bot in a read-it-later app and your responsibility is to help with automatic tagging. +Please 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 language must be in ${lang}. +- If the tag is not generic enough, don't include it. +- Aim for 10-15 tags. +- If there are no good tags, don't emit any. +${customPrompts && customPrompts.map((p) => `- ${p}`).join("\n")} +You must respond in valid JSON with the key "tags" and the value is list of tags. Don't wrap the response in a markdown code.`; +} + +export function buildTextPrompt( + lang: string, + customPrompts: string[], + content: string, +) { + return ` +You are a bot in a read-it-later app and your responsibility is to help with automatic tagging. +Please analyze the text between the sentences "CONTENT START HERE" and "CONTENT END HERE" 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 language must be in ${lang}. +- If it's a famous website you may also include a tag for the website. 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. +- Aim for 3-5 tags. +- If there are no good tags, leave the array empty. +${customPrompts && customPrompts.map((p) => `- ${p}`).join("\n")} +CONTENT START HERE +${content} +CONTENT END HERE +You must respond in JSON with the key "tags" and the value is an array of string tags.`; +} |
