Skip to content

Commit

Permalink
fix(workers): Add spaces in tag placeholders for better tokenization
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamedBassem committed Nov 24, 2024
1 parent fdf28ae commit 036554a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apps/workers/openaiWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,15 @@ async function replaceTagsPlaceholders(
): Promise<string[]> {
const api = await buildImpersonatingTRPCClient(userId);
const tags = (await api.tags.list()).tags;
const tagsString = `[${tags.map((tag) => tag.name).join(",")}]`;
const tagsString = `[${tags.map((tag) => tag.name).join(", ")}]`;
const aiTagsString = `[${tags
.filter((tag) => tag.numBookmarksByAttachedType.human ?? 0 == 0)
.map((tag) => tag.name)
.join(",")}]`;
.join(", ")}]`;
const userTagsString = `[${tags
.filter((tag) => tag.numBookmarksByAttachedType.human ?? 0 > 0)
.map((tag) => tag.name)
.join(",")}]`;
.join(", ")}]`;

return prompts.map((p) =>
p
Expand Down

0 comments on commit 036554a

Please sign in to comment.