diff options
| author | MohamedBassem <me@mbassem.com> | 2024-02-15 19:03:09 +0000 |
|---|---|---|
| committer | MohamedBassem <me@mbassem.com> | 2024-02-15 19:03:45 +0000 |
| commit | e4f4270790936db81364bab057d3cdb4bbdaa31e (patch) | |
| tree | 1e28567a8268f3342fb00f7a4ed417940fe5ab89 /packages | |
| parent | 97d18d7ac3bc6ab4f40618e74f021ee63a4cf7b6 (diff) | |
| download | karakeep-e4f4270790936db81364bab057d3cdb4bbdaa31e.tar.zst | |
fix: Attempt to improve the openai prompt a bit
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/workers/index.ts | 3 | ||||
| -rw-r--r-- | packages/workers/openai.ts | 8 |
2 files changed, 7 insertions, 4 deletions
diff --git a/packages/workers/index.ts b/packages/workers/index.ts index a58b2edf..c021ec67 100644 --- a/packages/workers/index.ts +++ b/packages/workers/index.ts @@ -1,10 +1,9 @@ import dotenv from "dotenv"; +dotenv.config(); import { CrawlerWorker } from "./crawler"; import { OpenAiWorker } from "./openai"; async function main() { - dotenv.config(); - const [crawler, openai] = [ await CrawlerWorker.build(), await OpenAiWorker.build(), diff --git a/packages/workers/openai.ts b/packages/workers/openai.ts index 1e353092..f48efdf5 100644 --- a/packages/workers/openai.ts +++ b/packages/workers/openai.ts @@ -44,8 +44,12 @@ export class OpenAiWorker { function buildPrompt(url: string, description: string) { return ` -You are a bot who given an article, extracts relevant "hashtags" out of them. -You must respond in JSON with the key "tags" and the value is list of tags. + +I'm building a read-it-later app and I need your help with automatic tagging. +Please analyze the following text and suggest relevant tags that describe its key themes, topics, and main ideas. +Aim for a variety of tags, including broad categories, specific keywords, and potential sub-genres. If it's a famous website +you may also include a tag for the website. Tags should be lowercases and don't contain spaces. If the tag is not generic enough, don't +include it. Aim for 3-5 tags. You must respond in JSON with the key "tags" and the value is list of tags. ---- URL: ${url} Description: ${description} |
