diff options
Diffstat (limited to 'packages/workers/openai.ts')
| -rw-r--r-- | packages/workers/openai.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/packages/workers/openai.ts b/packages/workers/openai.ts index cc456616..7dda1f9b 100644 --- a/packages/workers/openai.ts +++ b/packages/workers/openai.ts @@ -63,10 +63,20 @@ function buildPrompt( `No description found for link "${bookmark.id}". Skipping ...`, ); } + + let content = bookmark.link.content; + if (content) { + let words = content.split(" "); + if (words.length > 2000) { + words = words.slice(2000); + content = words.join(" "); + } + } return ` ${PROMPT_BASE} URL: ${bookmark.link.url} Description: ${bookmark.link.description} +Content: ${content || ""} `; } |
